Transform¶
The transform module takes data read by aare.CtbRawFile and decodes it
to a useful image format. Depending on detector it supports both analog
and digital samples.
For convenience the following transform objects are defined with a short name
moench05 = Moench05Transform()
moench05_1g = Moench05Transform1g()
moench05_old = Moench05TransformOld()
matterhorn02 = Matterhorn02Transform()
adc_sar_04_64to16 = AdcSar04Transform64to16()
adc_sar_05_64to16 = AdcSar05Transform64to16()
- class aare.transform.AdcSar04Transform64to16¶
Bases:
object- __call__(data)¶
Call self as a function.
- class aare.transform.AdcSar05060708Transform64to16¶
Bases:
object- __call__(data)¶
Call self as a function.
- class aare.transform.AdcSar05Transform64to16¶
Bases:
object- __call__(data)¶
Call self as a function.
- class aare.transform.Matterhorn02TransceiverTransform¶
Bases:
object- __call__(data)¶
Call self as a function.
- class aare.transform.Matterhorn10Transform(dynamic_range: int, num_counters: int)¶
Bases:
objectTransforms Matterhorn10 chip data from a buffer of bytes (uint8_t) to a numpy array of uint8, uint16 depending on dynamic range. Assumes data taken with transceiver samples only.
- Parameters:
dynamic_range (int) – How many bits a pixel is encoded dynamic range (4, 8, or 16)
num_counters (int) – num counters used (1 to 4)
Note
A matterhorn chip has 256 columns and 256 rows. A matterhornchip with dynamic range 16 and 2 counters thus requires 256*256*16*2/(2*64) = 1024 transceiver samples. (Per default 2 channels are enabled per transceiver sample, each channel storing 64 bits)
- __call__(data)¶
Call self as a function.
- compatibility(readingmode: ReadoutMode)¶
checks if Matterhorn10Transform is compatible with given parameters
- Parameters:
readingmode (ReadoutMode) – Reading mode set
- Raises:
ValueError – if not compatible
- data_compatibility(data)¶
checks if data is compatible for transformation
- Parameters:
data (np.ndarray) – data to be transformed, expected to be a 1D numpy array of uint8
- Raises:
ValueError – if not compatible
- class aare.transform.Moench04AnalogTransform¶
Bases:
object- __call__(data)¶
Call self as a function.
- class aare.transform.Mythen302Transform(offset=4)¶
Bases:
objectTransform Mythen 302 test chip data from a buffer of bytes (uint8_t) to a uint32 numpy array of [64,3] representing channels and counters. Assumes data taken with rx_dbitlist 17 6, rx_dbitreorder 1 and Digital Samples = 2310 [(64x3x24)/2 + some extra]
Note
The offset is in number of bits 0-7
- __call__(data: ndarray)¶
Transform buffer of data to a [64,3] np.ndarray of uint32.
- Parameters:
data (np.ndarray) – Expected dtype: uint8
- Returns:
image – uint32 array of size 64, 3
- Return type:
np.ndarray
- _n_channels = 64¶
- _n_counters = 3¶