Cluster¶
- class aare.Cluster(x: int, y: int, data, cluster_size=(3, 3), dtype=<class 'numpy.int32'>)¶
Factory function to create a Cluster object. Provides a cleaner syntax for the templated Cluster in C++.
from aare import Cluster Cluster(cluster_size=(3,3), dtype=np.float64)
Below is the API of a cluster of size \(3\times 3\) and type int but all variants share the same API.
- class aare._aare.Cluster3x3i¶
Bases:
pybind11_object
- __init__(self: aare._aare.Cluster3x3i, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex, arg2: Annotated[numpy.typing.ArrayLike, numpy.int32]) None¶
- property data¶
- max_sum_2x2(self: aare._aare.Cluster3x3i) tuple[int, int]¶
Return the highest-sum center-adjacent 2x2 subcluster.
- Returns:
(sum, index), where index is 0 for top-left, 1 for top-right, 2 for bottom-left, or 3 for bottom-right relative to the cluster center.- Return type:
tuple
- property x¶
- property y¶
Note
More functions can be found in the ClusterVector documentation. Generally apply functions directly on the ClusterVector instead of looping over individual clusters.