diff --git a/RELEASE.md b/RELEASE.md index 84cfaff..5dc220c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -10,8 +10,10 @@ Features: Bugfixes: - Fixed reading RawFiles with ROI fully excluding some sub files. +- Decoding of MH02 files placed the pixels in wrong position - Removed unused file: ClusterFile.cpp + ### 2025.05.22 Features: diff --git a/src/PixelMap.cpp b/src/PixelMap.cpp index 5be5ed4..575e201 100644 --- a/src/PixelMap.cpp +++ b/src/PixelMap.cpp @@ -104,22 +104,34 @@ NDArray GenerateEigerFlipRowsPixelMap() { } NDArray GenerateMH02SingleCounterPixelMap() { + // This is the pixel map for a single counter Matterhorn02, i.e. 48x48 pixels. + // Data is read from two transceivers in blocks of 4 pixels. NDArray order_map({48, 48}); + size_t offset = 0; + size_t nSamples = 4; for (int row = 0; row < 48; row++) { - for (int col = 0; col < 48; col++) { - order_map(row, col) = row * 48 + col; + for (int col = 0; col < 24; col++) { + for (int iTrans = 0; iTrans < 2; iTrans++) { + order_map(row, iTrans * 24 + col) = offset + nSamples * iTrans; + } + offset += 1; + if ((col + 1) % nSamples == 0) { + offset += nSamples; + } } } return order_map; } NDArray GenerateMH02FourCounterPixelMap() { + auto single_counter_map = GenerateMH02SingleCounterPixelMap(); NDArray order_map({4, 48, 48}); for (int counter = 0; counter < 4; counter++) { for (int row = 0; row < 48; row++) { for (int col = 0; col < 48; col++) { order_map(counter, row, col) = - counter * 48 * 48 + row * 48 + col; + single_counter_map(row, col) + + counter * 48 * 48; } } }