mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-06-06 02:28:40 +02:00
Added parsing of exptime and period from master files (#256)
- New aare:to_string/string_to similar to what we have in slsDetectorPackage - Added members period and exptime to RawMasterFile - Parsing exposure time and period for json and raw master file formats - Parsing of RawMasterFile from string stream to enable test without files Comments: - to_string is at the moment not a public header. Can make it later if needed. This gives us full freedom with the API - FileConfig should probably be deprecated need to look into it. Meanwhile removed python bindings and string conv
This commit is contained in:
@@ -85,5 +85,21 @@ void define_raw_master_file_bindings(py::module &m) {
|
||||
.def_property_readonly("quad", &RawMasterFile::quad)
|
||||
.def_property_readonly("scan_parameters",
|
||||
&RawMasterFile::scan_parameters)
|
||||
.def_property_readonly("roi", &RawMasterFile::roi);
|
||||
.def_property_readonly("roi", &RawMasterFile::roi)
|
||||
.def_property_readonly(
|
||||
"exptime",
|
||||
[](RawMasterFile &self) -> std::optional<double> {
|
||||
if (self.exptime()) {
|
||||
double seconds =
|
||||
std::chrono::duration<double>(*self.exptime()).count();
|
||||
return seconds;
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
})
|
||||
.def_property_readonly("period", [](RawMasterFile &self) {
|
||||
double seconds =
|
||||
std::chrono::duration<double>(self.period()).count();
|
||||
return seconds;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user