Dev/stuff from pyctbgui (#273)
Build on RHEL8 / build (push) Successful in 2m23s
Build on RHEL9 / build (push) Successful in 2m35s
Run tests using data on local RHEL8 / build (push) Failing after 3m19s

Matterhorn10 Transform 
some other Transformations from pyctbGUI 
added method get_reading_mode for easier error handling in decoders 


## TODO: 

- proper error handling for all other decoders 
- proper documentation for all other decoders 
- refactoring all other decoders to store hard coded values in a Struct
ChipSpecification
This commit is contained in:
2026-02-19 16:12:44 +01:00
committed by GitHub
parent 5dbc746462
commit 2139e5843c
19 changed files with 411 additions and 51 deletions
+10
View File
@@ -10,11 +10,21 @@ NDArray<ssize_t, 2> GenerateMoench03PixelMap();
NDArray<ssize_t, 2> GenerateMoench05PixelMap();
NDArray<ssize_t, 2> GenerateMoench05PixelMap1g();
NDArray<ssize_t, 2> GenerateMoench05PixelMapOld();
NDArray<ssize_t, 2> GenerateMoench04AnalogPixelMap();
// Matterhorn02
NDArray<ssize_t, 2> GenerateMH02SingleCounterPixelMap();
NDArray<ssize_t, 3> GenerateMH02FourCounterPixelMap();
/**
* @brief Generate pixel map for Matterhorn10 detector
* @param dynamic_range Dynamic range of the detector (16, 8, or 4)
* @param n_counters Number of counters (1 to 4)
*/
NDArray<ssize_t, 2>
GenerateMatterhorn10PixelMap(const size_t dynamic_range = 16,
const size_t n_counters = 1);
// Eiger
NDArray<ssize_t, 2> GenerateEigerFlipRowsPixelMap();
+5 -3
View File
@@ -97,9 +97,9 @@ class RawMasterFile {
size_t m_frame_padding{};
// TODO! should these be bool?
uint8_t m_analog_flag{};
uint8_t m_digital_flag{};
uint8_t m_transceiver_flag{};
bool m_analog_flag{};
bool m_digital_flag{};
bool m_transceiver_flag{};
ScanParameters m_scan_parameters;
@@ -135,6 +135,8 @@ class RawMasterFile {
size_t n_modules() const;
uint8_t quad() const;
ReadoutMode get_reading_mode() const;
std::optional<size_t> analog_samples() const;
std::optional<size_t> digital_samples() const;
std::optional<size_t> transceiver_samples() const;
+7
View File
@@ -38,6 +38,13 @@ uint32_t mask32to24bits(uint32_t input, BitOffset offset = {});
void expand24to32bit(NDView<uint8_t, 1> input, NDView<uint32_t, 1> output,
BitOffset offset = {});
/**
* @brief expands the two 4 bit values of an 8 bit buffer into two 8 bit values
* @param input input buffer with 4 bit values packed into 8 bit
* @param output output buffer with 8 bit values
*/
void expand4to8bit(NDView<uint8_t, 1> input, NDView<uint8_t, 1> output);
/**
* @brief Apply custom weights to a 16-bit input value. Will sum up
* weights[i]**i for each bit i that is set in the input value.
+40
View File
@@ -188,6 +188,46 @@ struct ROI {
}
};
/// @brief Chip specifications for Matterhorn1
struct Matterhorn10 {
constexpr static size_t nRows = 256;
constexpr static size_t nCols = 256;
};
/// @brief Chip specifications for Matterhorn2
struct Matterhorn02 {
constexpr static size_t nRows = 48;
constexpr static size_t nCols = 48;
constexpr static size_t nHalfCols = 24;
};
/// @brief Chip specifications for Moench04
struct Moench04 {
constexpr static size_t nRows = 400;
constexpr static size_t nCols = 400;
constexpr static std::array<int, 32>
adcNumbers =
{
9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3,
2, 5, 4, 7, 6, 23, 22, 21, 20, 19, 18,
17, 16, 31, 30, 29, 28, 27, 26, 25, 24}; // TODO : should we
// only have chip
// specifications or
// also wiring in
// chiptestboard?
constexpr static size_t nPixelsPerSuperColumn = 5000;
constexpr static size_t superColumnWidth = 25;
};
enum ReadoutMode : uint8_t {
ANALOG_ONLY = 0,
DIGITAL_ONLY = 1,
ANALOG_AND_DIGITAL = 2,
TRANSCEIVER_ONLY = 3,
DIGITAL_AND_TRANSCEIVER = 4,
UNKNOWN = 5
};
using dynamic_shape = std::vector<ssize_t>;
// TODO! Can we uniform enums between the libraries?