CUDA: double-precision device path, local-max fix, pedestal introspection

- DEVICE_PED_TYPE for device pedestal/variance (shipped double/double to match
    the double CPU ClusterFinder).
- Local-max suppression in Test 1/Test 3: non-peak pixels no longer store or
    update, mirroring ClusterFinder's `value < max -> continue`.
- device_pedestal()/device_noise() accessors (+ bindings) for the in-kernel
    decision-time pedestal.
This commit is contained in:
kferjaoui
2026-08-03 11:39:02 +02:00
parent 156667efde
commit 1bf317f42a
3 changed files with 142 additions and 35 deletions
+23
View File
@@ -66,6 +66,29 @@ void define_ClusterFinderCUDA(py::module &m, const std::string &typestr) {
return return_image_data(arr);
})
.def(
"device_pedestal",
[](CF &self, int stream) {
auto pd = new NDArray<pd_type, 2>{};
*pd = self.device_pedestal(stream);
return return_image_data(pd);
},
py::arg("stream") = 0,
R"(Device pedestal MEAN for a stream — the pedestal the kernel
actually decides with and updates each frame, unlike `pedestal` (the frozen
host pedestal). Read it before find_clusters() for the decision-time state.)")
.def(
"device_noise",
[](CF &self, int stream) {
auto arr = new NDArray<pd_type, 2>{};
*arr = self.device_noise(stream);
return return_image_data(arr);
},
py::arg("stream") = 0,
R"(Device pedestal RMS for a stream, computed as the kernel does:
sqrt(max(sum2/n - mean^2, 0)). Counterpart to `noise` for the device pedestal.)")
.def(
"steal_clusters",
[](CF &self, bool realloc_same_capacity) {