min_pedestal_samples is last argument
Build on RHEL9 / build (push) Successful in 2m33s
Build on RHEL8 / build (push) Successful in 3m41s
Run tests using data on local RHEL8 / build (push) Successful in 4m17s

This commit is contained in:
2026-09-03 17:09:15 +02:00
parent b117e34089
commit 567111c66e
5 changed files with 19 additions and 18 deletions
+4 -5
View File
@@ -18,7 +18,7 @@ def _get_class(name, cluster_size, dtype):
def ClusterFinder(image_size, cluster_size=(3,3), n_sigma=5, dtype = np.int32, capacity = 1024, min_pedestal_samples = 1000):
def ClusterFinder(image_size, *, cluster_size=(3,3), n_sigma=5, dtype = np.int32, capacity = 1024, min_pedestal_samples = 1000):
"""
Factory function to create a ClusterFinder object. Provides a cleaner syntax for
the templated ClusterFinder in C++.
@@ -42,8 +42,7 @@ def ClusterFinder(image_size, cluster_size=(3,3), n_sigma=5, dtype = np.int32, c
return cls(image_size, n_sigma=n_sigma, capacity=capacity, min_pedestal_samples=min_pedestal_samples)
def ClusterFinderMT(image_size, cluster_size = (3,3), dtype=np.int32, n_sigma=5, capacity = 1024, min_pedestal_samples = 1000, n_threads = 3):
def ClusterFinderMT(image_size, *, cluster_size = (3,3), dtype=np.int32, n_sigma=5, capacity = 1024, n_threads = 3, min_pedestal_samples = 1000):
"""
Factory function to create a ClusterFinderMT object. Provides a cleaner syntax for
the templated ClusterFinderMT in C++.
@@ -60,10 +59,10 @@ def ClusterFinderMT(image_size, cluster_size = (3,3), dtype=np.int32, n_sigma=5,
The data type of the image. Default is np.int32.
capacity : int, optional
The maximum number of clusters than can be stored before reallocating. Default is 1024.
min_pedestal_samples : int, optional
The minimum number of pedestal samples to accumulate before using the pedestal. Default is 1000.
n_threads : int, optional
The number of threads to use for processing. Default is 3.
min_pedestal_samples : int, optional
The minimum number of pedestal samples to accumulate before using the pedestal. Default is 1000.
"""
cls = _get_class("ClusterFinderMT", cluster_size, dtype)
+3 -2
View File
@@ -34,8 +34,9 @@ void define_ClusterFinderMT(py::module &m, const std::string &typestr) {
m, class_name.c_str())
.def(py::init<Shape<2>, pd_type, size_t, size_t, size_t, size_t>(),
py::arg("image_size"), py::arg("n_sigma") = 5.0,
py::arg("capacity") = 2048, py::arg("min_pedestal_samples") = 1000,
py::arg("n_threads") = 3, py::arg("queue_depth") = 16)
py::arg("capacity") = 2048, py::arg("n_threads") = 3,
py::arg("queue_depth") = 16,
py::arg("min_pedestal_samples") = 1000)
.def("push_pedestal_frame",
[](ClusterFinderMT<ClusterType, uint16_t, pd_type> &self,
py::array_t<uint16_t> frame) {