diff --git a/include/aare/utils/SparseMask.hpp b/include/aare/utils/SparseMask.hpp index 95b6966..acb1e4f 100644 --- a/include/aare/utils/SparseMask.hpp +++ b/include/aare/utils/SparseMask.hpp @@ -38,6 +38,9 @@ class SparseMask { void write_to_file(const std::filesystem::path &filename) const; + /// @brief Get number of bad channels + size_t num_bad_channels() const; + private: /// @brief stoarge format of the sparse mask, either row major or column /// major diff --git a/python/aare/__init__.py b/python/aare/__init__.py index 10872f8..35f90ed 100644 --- a/python/aare/__init__.py +++ b/python/aare/__init__.py @@ -54,3 +54,5 @@ from ._aare import ( PixelHistogram_u32, PixelHistogram_u64, ) + +from ._aare import SparseMask diff --git a/python/src/module.cpp b/python/src/module.cpp index 023a19e..e8d2c5c 100644 --- a/python/src/module.cpp +++ b/python/src/module.cpp @@ -17,6 +17,7 @@ #include "bind_PixelMap.hpp" #include "bind_RawFile.hpp" #include "bind_calibration.hpp" +#include "utils/bind_SparseMask.hpp" // TODO! migrate the other names #include "ctb_raw_file.hpp" @@ -73,6 +74,7 @@ PYBIND11_MODULE(_aare, m) { define_fit_bindings(m); define_interpolation_bindings(m); define_jungfrau_data_file_io_bindings(m); + define_sparse_mask_bindings(m); bind_calibration(m); diff --git a/src/utils/SparseMask.cpp b/src/utils/SparseMask.cpp index cbbbc3b..b49d164 100644 --- a/src/utils/SparseMask.cpp +++ b/src/utils/SparseMask.cpp @@ -61,4 +61,6 @@ bool SparseMask::is_masked(const size_t row, const size_t col) const { } } +size_t SparseMask::num_bad_channels() const { return innerindices_.size(); } + } // namespace aare \ No newline at end of file