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)
Note
Due to an artefact in the chip, the transformation only fully supports 2 or 4 counters. Also if you enable 2 counters you can only select counter 1 and 2 or 0, 3 to get reasonable results. Otherwise only the first half of the image is correct.
- __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(n_counters, n_rows, n_cols)) – 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.Moench05Transform¶
Bases:
objectTransforms Moench05 chip data from a buffer of bytes (uint8_t) to a numpy array of uint16. Assumes data taken with analog samples and assumes adc 1, 9, 13 are enabled. (e.g. for 10g mode adc 0,1,2,3 and 8,9,10,11 and 12,13,14,15 are enabled but only adc 1,9,13 contain relevant data)
Note
A moench05 chip has 160 rows and 50 cols per adc and has dynamic range 16 bit. Each adc sample is encoded in 16 bits. The transformation thus requires 160*50*16/16 = 8000 analog samples per adc.
- __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¶