mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-05-01 07:32:24 +02:00
allow passing mask to clustervector
This commit is contained in:
@@ -35,6 +35,22 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
|
||||
|
||||
.def(py::init()) // TODO change!!!
|
||||
|
||||
.def(
|
||||
"__call__",
|
||||
[](ClusterVector<ClusterType> &self, py::array_t<bool> mask) {
|
||||
return self(make_view_1d(mask));
|
||||
},
|
||||
py::arg("mask"), R"(
|
||||
Create a copy of the clustervector and apply a boolean mask to the ClusterVector.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
mask : 1d boolean numpy array
|
||||
Mask to apply to the ClusterVector. Must be the same length as the number of clusters in the ClusterVector.
|
||||
|
||||
)")
|
||||
|
||||
.def("push_back",
|
||||
[](ClusterVector<ClusterType> &self, const ClusterType &cluster) {
|
||||
self.push_back(cluster);
|
||||
|
||||
Reference in New Issue
Block a user