digi — Digitization facilities#
This module contains…
Digi event structure#
@dataclass
class DigiEventRectangular(DigiEventBase):
"""Specialized class for a digitized event based on a rectangular ROI.
This implements the basic legacy machinery of the XPOL-I and XPOL-III readout chips.
"""
roi: RegionOfInterest
Module documentation#
Digi event structures.
- class hexsample.digi.DigiEventBase(trigger_id: int, seconds: int, microseconds: int, livetime: int, pha: ndarray)[source]#
Base class for a digitized event.
This includes alll the timing information that is common to the different digitized event structure, as well as the PHA content of the pixels in the event, but no information about the physical location on the latter within the readout chip. It is responsibility of the derived classes to provide this information, in the way that is more conventient, depending on the particular readout strategy.
Arguments#
- trigger_idint
The trigger identifier.
- secondsint
The integer part of the timestamp.
- microsecondsint
The fractional part of the timestamp.
- phanp.ndarray
The pixel content of the event, in the form of a 1-dimensional array.
- trigger_id: int#
- seconds: int#
- microseconds: int#
- livetime: int#
- pha: ndarray#
- timestamp() float[source]#
Return the timestamp of the event, that is, the sum of the second and microseconds parts of the DigiEvent contributions as a floating point number.
- class hexsample.digi.DigiEventRectangular(trigger_id: int, seconds: int, microseconds: int, livetime: int, pha: ndarray, roi: RegionOfInterest)[source]#
Specialized class for a digitized event based on a rectangular ROI.
This implements the basic legacy machinery of the XPOL-I and XPOL-III readout chips.
- roi: RegionOfInterest#
- classmethod from_digi(file_row: ndarray, pha: ndarray)[source]#
Alternative constructor rebuilding an object from a row on a digi file.
This is used internally when we access event data in a digi file, and we need to reassemble a DigiEvent object from a given row of a digi table.
- highest_pixel(absolute: bool = True) Tuple[int, int][source]#
Return the coordinates (col, row) of the highest pixel.
Arguments#
- absolutebool
If true, the absolute coordinates (i.e., those referring to the readout chip) are returned; otherwise the coordinates are intended relative to the readout window (i.e., they can be used to index the pha array).
- class hexsample.digi.DigiEventCircular(trigger_id: int, seconds: int, microseconds: int, livetime: int, pha: ndarray, column: int, row: int)[source]#
Circular digitized event.
In this particular incarnation of a digitized event the ROI is built around a central pixel, that is the one corresponding to maximum PHA. The ROI is then always (except in border-pixel cases) composed by 7 pixels: the central one and its 6 neighbours.
Arguments#
- columnint
The column identifier of the maximum PHA pixel in the event in pixel coordinates.
- rowint
The column identifier of the maximum PHA pixel in the event in pixel coordinates.
- column: int#
- row: int#