mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-17 19:35:14 +02:00
bindings for xy
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
@@ -74,6 +75,21 @@ void define_defs_bindings(py::module &m) {
|
||||
self.ymin == other.ymin && self.ymax == other.ymax;
|
||||
});
|
||||
|
||||
py::class_<xy>(m, "xy")
|
||||
.def(py::init<uint32_t, uint32_t>(), py::arg("row"), py::arg("col"))
|
||||
.def_readwrite("row", &xy::row)
|
||||
.def_readwrite("col", &xy::col)
|
||||
.def("__repr__",
|
||||
[](const xy &self) {
|
||||
return fmt::format("xy(row={}, col={})", self.row, self.col);
|
||||
})
|
||||
.def("__iter__",
|
||||
[](const xy &self) {
|
||||
return py::iter(py::make_tuple(self.row, self.col));
|
||||
})
|
||||
.def(py::self == py::self)
|
||||
.def(py::self != py::self);
|
||||
|
||||
py::enum_<DetectorType>(m, "DetectorType")
|
||||
.value("Jungfrau", DetectorType::Jungfrau)
|
||||
.value("Eiger", DetectorType::Eiger)
|
||||
|
||||
@@ -318,7 +318,14 @@ void define_raw_file_io_bindings(py::module &m) {
|
||||
Cols for the given ROI.
|
||||
)")
|
||||
.def_property_readonly("bitdepth", &RawFile::bitdepth)
|
||||
.def_property_readonly("geometry", &RawFile::geometry)
|
||||
.def_property_readonly("geometry", &RawFile::geometry, R"(
|
||||
Number of modules along each axis of the detector.
|
||||
|
||||
Returns
|
||||
-------
|
||||
xy
|
||||
Module rows and columns.
|
||||
)")
|
||||
.def_property_readonly("detector_type", &RawFile::detector_type)
|
||||
.def_property_readonly("master", &RawFile::master)
|
||||
.def_property_readonly("n_modules", &RawFile::n_modules)
|
||||
|
||||
@@ -67,9 +67,23 @@ void define_raw_master_file_bindings(py::module &m) {
|
||||
.def_property_readonly("total_frames_expected",
|
||||
&RawMasterFile::total_frames_expected)
|
||||
.def_property_readonly("detector_layout",
|
||||
&RawMasterFile::detector_layout)
|
||||
&RawMasterFile::detector_layout, R"(
|
||||
Number of modules along each axis of the detector
|
||||
|
||||
Returns
|
||||
----------
|
||||
xy
|
||||
Module rows and columns
|
||||
)")
|
||||
.def_property_readonly("udp_interfaces_per_module",
|
||||
&RawMasterFile::udp_interfaces_per_module)
|
||||
&RawMasterFile::udp_interfaces_per_module, R"(
|
||||
Number of UDP interfaces along each axis of a module
|
||||
|
||||
Returns
|
||||
----------
|
||||
xy
|
||||
UDP interface rows and columns
|
||||
)")
|
||||
.def_property_readonly("analog_samples", &RawMasterFile::analog_samples,
|
||||
R"(
|
||||
Number of analog samples
|
||||
|
||||
Reference in New Issue
Block a user