mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-07-27 09:32:50 +02:00
added mask in PedestalTrackingHistogram
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user