mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-12-20 03:51:27 +01:00
- added rosenblatttransform - added 3x3 eta methods - interpolation can be used with various eta functions - added documentation for interpolation, eta calculation - exposed full eta struct in python - disable ClusterFinder for 2x2 clusters - factory function for ClusterVector --------- Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch> Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
24 lines
741 B
Python
24 lines
741 B
Python
from . import _aare
|
|
import numpy as np
|
|
from .ClusterFinder import _type_to_char
|
|
|
|
|
|
def Cluster(x : int, y : int, data, cluster_size=(3,3), dtype = np.int32):
|
|
"""
|
|
Factory function to create a Cluster object. Provides a cleaner syntax for
|
|
the templated Cluster in C++.
|
|
|
|
.. code-block:: python
|
|
|
|
from aare import Cluster
|
|
|
|
Cluster(cluster_size=(3,3), dtype=np.float64)
|
|
"""
|
|
|
|
try:
|
|
class_name = f"Cluster{cluster_size[0]}x{cluster_size[1]}{_type_to_char(dtype)}"
|
|
cls = getattr(_aare, class_name)
|
|
except AttributeError:
|
|
raise ValueError(f"Unsupported combination of type and cluster size: {dtype}/{cluster_size} when requesting {class_name}")
|
|
|
|
return cls(x, y, data) |