fix/mh02 map (#214)
All checks were successful
Build on RHEL9 / build (push) Successful in 3m8s
Build on RHEL8 / build (push) Successful in 3m13s

- Fixed bug in reading MH02 files
This commit is contained in:
2025-07-17 15:32:40 +02:00
committed by GitHub
2 changed files with 17 additions and 3 deletions

View File

@@ -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:

View File

@@ -104,22 +104,34 @@ NDArray<ssize_t, 2> GenerateEigerFlipRowsPixelMap() {
}
NDArray<ssize_t, 2> 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<ssize_t, 2> 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<ssize_t, 3> GenerateMH02FourCounterPixelMap() {
auto single_counter_map = GenerateMH02SingleCounterPixelMap();
NDArray<ssize_t, 3> 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;
}
}
}