mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-20 05:38:41 +01:00
Fix/mythenfilereading (#250)
Add counter mask as member of RawFile BugFix: temporarily handle -1 for ROI in mythenfile
This commit is contained in:
@@ -143,6 +143,10 @@ std::optional<size_t> RawMasterFile::number_of_rows() const {
|
||||
return m_number_of_rows;
|
||||
}
|
||||
|
||||
std::optional<uint8_t> RawMasterFile::counter_mask() const {
|
||||
return m_counter_mask;
|
||||
}
|
||||
|
||||
xy RawMasterFile::geometry() const { return m_geometry; }
|
||||
|
||||
size_t RawMasterFile::n_modules() const {
|
||||
@@ -313,15 +317,26 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) {
|
||||
}
|
||||
|
||||
// if any of the values are set update the roi
|
||||
// TODO: doesnt it write garbage if one of them is not set
|
||||
if (tmp_roi.xmin != 4294967295 || tmp_roi.xmax != 4294967295 ||
|
||||
tmp_roi.ymin != 4294967295 || tmp_roi.ymax != 4294967295) {
|
||||
tmp_roi.xmax++;
|
||||
// Handle Mythen
|
||||
if (tmp_roi.ymin == -1 && tmp_roi.ymax == -1) {
|
||||
tmp_roi.ymin = 0;
|
||||
tmp_roi.ymax = 0;
|
||||
}
|
||||
tmp_roi.ymax++;
|
||||
m_roi = tmp_roi;
|
||||
}
|
||||
|
||||
} catch (const json::out_of_range &e) {
|
||||
LOG(TLogLevel::logERROR) << e.what() << std::endl;
|
||||
// leave the optional empty
|
||||
}
|
||||
try {
|
||||
// TODO: what is the best format to handle
|
||||
m_counter_mask = j.at("Counter Mask");
|
||||
} catch (const json::out_of_range &e) {
|
||||
// leave the optional empty
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user