mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-29 03:11:29 +01:00
Fixed ClusterVector move, filtering, and improved documentation (#357)
- Default `ClusterVector` move operations simplifying the code and fixing a bug. - Fixed inconsistent frame number type (uint64/int32) - Validate Python masks as one-dimensional, C-contiguous Boolean arrays, handle empty masks safely, and reserve filtered storage based on the selected cluster count. - Align the C++ and Python API documentation with the implementation, including concise `hitmap` and reduction documentation and a correctly rendered constructor example.
This commit is contained in:
1 parent
4eb2bfcfcc
commit
dd409cfe41
11 files changed
+450
-187
No files matched your search
@@ -7,16 +7,33 @@ from .ClusterFinder import _get_class
|
||||
|
||||
def ClusterVector(cluster_size=(3,3), dtype = np.int32):
|
||||
"""
|
||||
Factory function to create a ClusterVector object. Provides a cleaner syntax for
|
||||
the templated ClusterVector in C++.
|
||||
Create an empty ClusterVector for a supported cluster size and pixel dtype.
|
||||
|
||||
.. code-block:: python
|
||||
Parameters
|
||||
----------
|
||||
cluster_size : tuple[int, int], default=(3, 3)
|
||||
Cluster dimensions in the x and y directions.
|
||||
dtype : numpy.dtype, default=numpy.int32
|
||||
Pixel storage type. The cluster size and dtype combination must have a
|
||||
compiled binding.
|
||||
|
||||
from aare import ClusterVector
|
||||
|
||||
ClusterVector(cluster_size=(3,3), dtype=np.float64)
|
||||
Returns
|
||||
-------
|
||||
ClusterVector
|
||||
An empty vector with frame number 0 and space reserved for at least
|
||||
1024 clusters.
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If the requested size and dtype combination is unavailable.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> import numpy as np
|
||||
>>> from aare import ClusterVector
|
||||
>>> clusters = ClusterVector(cluster_size=(3, 3), dtype=np.float64)
|
||||
"""
|
||||
|
||||
cls = _get_class("ClusterVector", cluster_size, dtype)
|
||||
return cls()
|
||||
|
||||
Reference in new issue
Block a user