mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-12 23:37:13 +02:00
Cluster cuts (#146)
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 43s
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 43s
Co-authored-by: Patrick <patrick.sieberer@psi.ch> Co-authored-by: JulianHeymes <julian.heymes@psi.ch> Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch> Co-authored-by: Xiangyu Xie <45243914+xiangyuxie@users.noreply.github.com> Co-authored-by: xiangyu.xie <xiangyu.xie@psi.ch>
This commit is contained in:
@ -31,26 +31,22 @@ void define_cluster_file_io_bindings(py::module &m) {
|
||||
auto v = new ClusterVector<int32_t>(self.read_clusters(n_clusters));
|
||||
return v;
|
||||
},py::return_value_policy::take_ownership)
|
||||
.def("read_clusters",
|
||||
[](ClusterFile &self, size_t n_clusters, ROI roi) {
|
||||
auto v = new ClusterVector<int32_t>(self.read_clusters(n_clusters, roi));
|
||||
return v;
|
||||
},py::return_value_policy::take_ownership)
|
||||
.def("read_frame",
|
||||
[](ClusterFile &self) {
|
||||
auto v = new ClusterVector<int32_t>(self.read_frame());
|
||||
return v;
|
||||
})
|
||||
.def("set_roi", &ClusterFile::set_roi)
|
||||
.def("set_noise_map", [](ClusterFile &self, py::array_t<int32_t> noise_map) {
|
||||
auto view = make_view_2d(noise_map);
|
||||
self.set_noise_map(view);
|
||||
})
|
||||
.def("set_gain_map", [](ClusterFile &self, py::array_t<double> gain_map) {
|
||||
auto view = make_view_2d(gain_map);
|
||||
self.set_gain_map(view);
|
||||
})
|
||||
.def("close", &ClusterFile::close)
|
||||
.def("write_frame", &ClusterFile::write_frame)
|
||||
// .def("read_cluster_with_cut",
|
||||
// [](ClusterFile &self, size_t n_clusters,
|
||||
// py::array_t<double> noise_map, int nx, int ny) {
|
||||
// auto view = make_view_2d(noise_map);
|
||||
// auto *vec =
|
||||
// new std::vector<Cluster3x3>(self.read_cluster_with_cut(
|
||||
// n_clusters, view.data(), nx, ny));
|
||||
// return return_vector(vec);
|
||||
// })
|
||||
.def("__enter__", [](ClusterFile &self) { return &self; })
|
||||
.def("__exit__",
|
||||
[](ClusterFile &self,
|
||||
|
Reference in New Issue
Block a user