mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-09 18:33:56 +01:00
Reject raw files without padding if discard partial is not set (#374)
We have no code in aare to deal with RawFiles that have missing packets if they are not padded to full size or frames with packet loss dropped. Added: - check that we don't try to read files that are not supported - python bindings for frame discard policy at least we get the check in: closes #171 --------- Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
This commit is contained in:
1 parent
97ddf6e7c1
commit
0dc72634a9
12 files changed
+181
-8
No files matched your search
@@ -29,6 +29,14 @@ RawFile::RawFile(const std::filesystem::path &fname, const std::string &mode)
|
||||
m_mode = mode;
|
||||
|
||||
if (mode == "r") {
|
||||
if (m_master.frame_padding() == 0 &&
|
||||
m_master.frame_discard_policy() !=
|
||||
FrameDiscardPolicy::DiscardPartial) {
|
||||
throw std::runtime_error(fmt::format(
|
||||
"Cannot open '{}': RawFile requires frame padding or "
|
||||
"discardpartial.",
|
||||
m_master.master_fname().string()));
|
||||
}
|
||||
|
||||
m_subfiles.resize(m_master.roi_geometries().size());
|
||||
// iterate over all ROIS
|
||||
|
||||
Reference in new issue
Block a user