ClusterVector

The ClusterVector, holds clusters from the ClusterFinder. Since it is templated in C++ we use a suffix indicating the type of cluster it holds. The suffix follows the same pattern as for ClusterFile i.e. ClusterVector_Cluster3x3i for a vector holding 3x3 integer clusters.

At the moment the functionality from python is limited and it is not supported to push_back clusters to the vector. The intended use case is to pass it to C++ functions that support the ClusterVector or to view it as a numpy array.

View ClusterVector as numpy array

from aare import ClusterFile
with ClusterFile("path/to/file") as f:
    cluster_vector = f.read_frame()

# Create a copy of the cluster data in a numpy array
clusters = np.array(cluster_vector)

# Avoid copying the data by passing copy=False
clusters = np.array(cluster_vector, copy = False)
class aare.ClusterVector(cluster_size=(3, 3), dtype=<class 'numpy.int32'>)

Factory function to create a ClusterVector object. Provides a cleaner syntax for the templated ClusterVector in C++.

from aare import ClusterVector

ClusterVector(cluster_size=(3,3), dtype=np.float64)

Below is the API of the ClusterVector_Cluster3x3i but all variants share the same API.

class aare._aare.ClusterVector_Cluster3x3i

Bases: pybind11_object

__init__(self: aare._aare.ClusterVector_Cluster3x3i) None
property capacity
property cluster_size_x
property cluster_size_y
property fmt
property frame_number
item_size(self: aare._aare.ClusterVector_Cluster3x3i) int
push_back(self: aare._aare.ClusterVector_Cluster3x3i, arg0: aare::Cluster<int, (unsigned char)3, (unsigned char)3, unsigned short>) None
property size
sum(self: aare._aare.ClusterVector_Cluster3x3i) numpy.ndarray
sum_2x2(self: aare._aare.ClusterVector_Cluster3x3i) numpy.ndarray

calculates sum of 2x2 subcluster with highest energy and index relative to cluster center 0: top_left, 1: top_right, 2: bottom_left, 3: bottom_right

Free Functions:

aare.reduce_to_3x3(*args, **kwargs)

Overloaded function.

  1. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster3x3i) -> aare._aare.ClusterVector_Cluster3x3i

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  2. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster3x3d) -> aare._aare.ClusterVector_Cluster3x3d

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  3. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster3x3f) -> aare._aare.ClusterVector_Cluster3x3f

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  4. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster5x5i) -> aare._aare.ClusterVector_Cluster3x3i

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  5. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster5x5d) -> aare._aare.ClusterVector_Cluster3x3d

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  6. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster5x5f) -> aare._aare.ClusterVector_Cluster3x3f

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  7. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster7x7i) -> aare._aare.ClusterVector_Cluster3x3i

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  8. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster7x7d) -> aare._aare.ClusterVector_Cluster3x3d

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  9. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster7x7f) -> aare._aare.ClusterVector_Cluster3x3f

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  10. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster9x9i) -> aare._aare.ClusterVector_Cluster3x3i

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  11. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster9x9d) -> aare._aare.ClusterVector_Cluster3x3d

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  12. reduce_to_3x3(clustervector: aare._aare.ClusterVector_Cluster9x9f) -> aare._aare.ClusterVector_Cluster3x3f

    Reduce cluster to 3x3 subcluster

    Parameters

    cv : ClusterVector

  13. reduce_to_3x3(arg0: aare._aare.Cluster3x3i) -> aare._aare.Cluster3x3i

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster3x3d) -> aare._aare.Cluster3x3d

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster3x3f) -> aare._aare.Cluster3x3f

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster5x5i) -> aare._aare.Cluster3x3i

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster5x5d) -> aare._aare.Cluster3x3d

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster5x5f) -> aare._aare.Cluster3x3f

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster7x7i) -> aare._aare.Cluster3x3i

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster7x7d) -> aare._aare.Cluster3x3d

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster7x7f) -> aare._aare.Cluster3x3f

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster9x9i) -> aare._aare.Cluster3x3i

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster9x9d) -> aare._aare.Cluster3x3d

Reduce cluster to 3x3 subcluster

  1. reduce_to_3x3(arg0: aare._aare.Cluster9x9f) -> aare._aare.Cluster3x3f

Reduce cluster to 3x3 subcluster

Reduce a single Cluster to 3x3 by taking the 3x3 subcluster with highest photon energy.

aare.reduce_to_2x2(*args, **kwargs)

Overloaded function.

  1. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster3x3i) -> aare::ClusterVector<aare::Cluster<int, (unsigned char)2, (unsigned char)2, unsigned short>, void>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  2. reduce_to_2x2(arg0: aare._aare.Cluster3x3i) -> aare::Cluster<int, (unsigned char)2, (unsigned char)2, unsigned short>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  3. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster3x3d) -> aare::ClusterVector<aare::Cluster<double, (unsigned char)2, (unsigned char)2, unsigned short>, void>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  4. reduce_to_2x2(arg0: aare._aare.Cluster3x3d) -> aare::Cluster<double, (unsigned char)2, (unsigned char)2, unsigned short>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  5. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster3x3f) -> aare::ClusterVector<aare::Cluster<float, (unsigned char)2, (unsigned char)2, unsigned short>, void>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  6. reduce_to_2x2(arg0: aare._aare.Cluster3x3f) -> aare::Cluster<float, (unsigned char)2, (unsigned char)2, unsigned short>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  7. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster2x2i) -> aare._aare.ClusterVector_Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  8. reduce_to_2x2(arg0: aare._aare.Cluster2x2i) -> aare._aare.Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  9. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster2x2d) -> aare._aare.ClusterVector_Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  10. reduce_to_2x2(arg0: aare._aare.Cluster2x2d) -> aare._aare.Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  11. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster2x2f) -> aare._aare.ClusterVector_Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  12. reduce_to_2x2(arg0: aare._aare.Cluster2x2f) -> aare._aare.Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  13. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster5x5i) -> aare._aare.ClusterVector_Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  14. reduce_to_2x2(arg0: aare._aare.Cluster5x5i) -> aare._aare.Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  15. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster5x5d) -> aare._aare.ClusterVector_Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  16. reduce_to_2x2(arg0: aare._aare.Cluster5x5d) -> aare._aare.Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  17. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster5x5f) -> aare._aare.ClusterVector_Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  18. reduce_to_2x2(arg0: aare._aare.Cluster5x5f) -> aare._aare.Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  19. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster7x7i) -> aare._aare.ClusterVector_Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  20. reduce_to_2x2(arg0: aare._aare.Cluster7x7i) -> aare._aare.Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  21. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster7x7d) -> aare._aare.ClusterVector_Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  22. reduce_to_2x2(arg0: aare._aare.Cluster7x7d) -> aare._aare.Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  23. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster7x7f) -> aare._aare.ClusterVector_Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  24. reduce_to_2x2(arg0: aare._aare.Cluster7x7f) -> aare._aare.Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  25. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster9x9i) -> aare._aare.ClusterVector_Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  26. reduce_to_2x2(arg0: aare._aare.Cluster9x9i) -> aare._aare.Cluster2x2i

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  27. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster9x9d) -> aare._aare.ClusterVector_Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  28. reduce_to_2x2(arg0: aare._aare.Cluster9x9d) -> aare._aare.Cluster2x2d

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  29. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster9x9f) -> aare._aare.ClusterVector_Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  30. reduce_to_2x2(arg0: aare._aare.Cluster9x9f) -> aare._aare.Cluster2x2f

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  31. reduce_to_2x2(clustervector: aare._aare.ClusterVector_Cluster3x3i16) -> aare::ClusterVector<aare::Cluster<short, (unsigned char)2, (unsigned char)2, unsigned short>, void>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    Parameters

    cv : ClusterVector (clusters are filled in row-major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

  32. reduce_to_2x2(arg0: aare._aare.Cluster3x3i16) -> aare::Cluster<short, (unsigned char)2, (unsigned char)2, unsigned short>

    Reduce cluster to 2x2 subcluster by taking the 2x2 subcluster with the highest photon energy.

    RETURN:

    reduced cluster (cluster is filled in row major ordering starting at the top left. Thus for a max subcluster in the top left corner the photon hit is at the fourth position.)

Reduce a single Cluster to 2x2 by taking the 2x2 subcluster with highest photon energy.