added mask in PedestalTrackingHistogram
Build on RHEL9 / build (push) Failing after 2m39s
Build on RHEL8 / build (push) Failing after 3m29s
Run tests using data on local RHEL8 / build (push) Successful in 3m58s

This commit is contained in:
2026-07-01 16:53:25 +02:00
parent 3b41a798a1
commit b579e48860
3 changed files with 48 additions and 13 deletions
@@ -15,9 +15,21 @@ void define_pedestal_tracking_pixel_histogram_bindings(py::module &m) {
m, "PedestalTrackingPixelHistogram",
"A pixel-wise histogram of frame - pedestal residuals, with a "
"per-pixel running pedestal estimate sharded across worker threads")
.def(
py::init<int, int, int, double, double, int, std::size_t, double>(),
R"(
.def(py::init([](int rows, int cols, int n_bins, double xmin, double xmax, int n_threads, std::size_t max_pending,
double n_sigma, std::optional<py::array_t<bool,
py::array::c_style | py::array::forcecast>> mask) {
if (mask.has_value()) {
auto view = make_view_2d(mask.value());
return new PedestalTrackingPixelHistogram(
rows, cols, n_bins, xmin, xmax, n_threads, max_pending,
n_sigma, view);
} else {
return new PedestalTrackingPixelHistogram(
rows, cols, n_bins, xmin, xmax, n_threads, max_pending,
n_sigma);
}
}),
R"(
Initialize a PedestalTrackingPixelHistogram.
Args:
@@ -42,10 +54,16 @@ void define_pedestal_tracking_pixel_histogram_bindings(py::module &m) {
``0.0`` to disable the pedestal update and get
histogram-only async behaviour (default: 1.0).
Also exposed live via the ``n_sigma`` property.
mask: Optional 2D boolean array (shape: rows x cols) that
indicates bad pixels. True values indicate bad pixels
that will be skipped during pedestal tracking and
histogramming. If not provided, all pixels are treated
as good.
)",
py::kw_only(), py::arg("rows"), py::arg("cols"), py::arg("n_bins"),
py::arg("xmin"), py::arg("xmax"), py::arg("n_threads") = 1,
py::arg("max_pending") = std::size_t{16}, py::arg("n_sigma") = 1.0)
py::kw_only(), py::arg("rows"), py::arg("cols"), py::arg("n_bins"),
py::arg("xmin"), py::arg("xmax"), py::arg("n_threads") = 1,
py::arg("max_pending") = std::size_t{16}, py::arg("n_sigma") = 1.0,
py::arg("mask") = std::nullopt)
.def(
"push_pedestal_no_update",