Fixed seek bug in CtbRawFile (#373)
Build on RHEL9 / build (push) Successful in 2m49s
Build on RHEL8 / build (push) Successful in 3m25s
Run tests using data on local RHEL8 / build (push) Successful in 4m27s
Build on local RHEL8 / build (push) Successful in 3m6s

- seek to the edge of a file + read_into would select the wrong file
- Visible for example in f.read_frame(index) in python

Added fix, release notes and a small test. 

closes #371

Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
This commit is contained in:
Erik Fröjdh
2026-09-17 08:09:12 +02:00
committed by GitHub
co-authored by mazzol_a
parent 8551281eb7
commit b558f1146b
4 changed files with 70 additions and 5 deletions
+4 -4
View File
@@ -24,9 +24,9 @@ void CtbRawFile::read_into(std::byte *image_buf, DetectorHeader *header) {
throw std::runtime_error(LOCATION + " End of file reached");
}
if (m_current_frame != 0 &&
m_current_frame % m_master.max_frames_per_file() == 0) {
open_data_file(m_current_subfile + 1);
const auto index = sub_file_index(m_current_frame);
if (index != m_current_subfile) {
open_data_file(index);
}
if (header) {
@@ -79,4 +79,4 @@ void CtbRawFile::open_data_file(size_t subfile_index) {
}
}
} // namespace aare
} // namespace aare