calix.common.cadc

Calibrates all CADC channels on Hicann-X for a given dynamic range.

Classes

CADCCalibOptions(calibrate_offsets)

Further configuration parameters for the CADC calibration, that are not directly calibration targets.

CADCCalibResult(target, options, …)

Result object for the CADC calibration.

CADCCalibTarget(dynamic_range, read_range)

Target parameters for the CADC calibration.

ChannelOffsetCalib(dynamic_range_mid)

CADC Calibration part 3: Calibrating digital offsets of individual channels.

RampOffsetCalib(target, dynamic_range_min)

CADC Calibration Part 1: Calibrate the ramp reset/start voltage.

RampSlopeCalib(target, dynamic_range_max)

CADC Calibration part 2: Calibrate the steepness of the ramp, i.e. the current onto the ramp capacitor.

Functions

calix.common.cadc.calibrate(connection: pyhxcomm_vx.ConnectionHandle, target: Optional[calix.common.cadc.CADCCalibTarget] = None, options: Optional[calix.common.cadc.CADCCalibOptions] = None)calix.common.cadc.CADCCalibResult

Calibrates all the CADCs (top, bottom, causal, acausal) to work in a given dynamic range (given as CapMem LSB voltage settings). After calling this function, the CADC is left in a calibrated state, ready for usage.

Part 1 sets the reset voltage of the CADC ramp depending on the given minimum of the dynamic range for readout. The reset voltage is set slightly below this desired readout, such that the CADC reads read_range.lower (default: 20) there (to avoid clipping of channels that get high offsets later).

Part 2 sets the ramp current (steepness) depending on the given maximum of the dynamic range for readout. The current is set such that the ramp crosses the upper end of the dynamic readout range when the counter reads read_range.upper (default: 220). This is partly to avoid the last part of the dynamic range as the ramp will become less linear, and again to avoid clipping of channels with higher offsets.

Part 3 applies a constant calibration voltage to all CADC channels, chosen in the middle of the dynamic range, and requires all channels to read the same result. The digital offsets are set to compensate the observed differences in reads.

Parameters
  • connection – Connection to a chip that this calibration will run on.

  • target – Target parameters for calibration, given as an instance of CADCCalibTarget. Refer there for the individual parameters.

  • options – Further options for calibration, given as an instance of CADCCalibOptions. Refer there for the individual parameters.

Returns

CADCCalibResult, containing the settings for the CADC ramps of each quadrant and the digital offsets and calibration success of each channel.

calix.common.cadc.dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)

Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.

Examines PEP 526 __annotations__ to determine fields.

If init is true, an __init__() method is added to the class. If repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method function is added. If frozen is true, fields may not be assigned to after instance creation.

calix.common.cadc.field(*, default=<dataclasses._MISSING_TYPE object>, default_factory=<dataclasses._MISSING_TYPE object>, init=True, repr=True, hash=None, compare=True, metadata=None)

Return an object to identify dataclass fields.

default is the default value of the field. default_factory is a 0-argument function called to initialize a field’s value. If init is True, the field will be a parameter to the class’s __init__() function. If repr is True, the field will be included in the object’s repr(). If hash is True, the field will be included in the object’s hash(). If compare is True, the field will be used in comparison functions. metadata, if specified, must be a mapping which is stored but not otherwise examined by dataclass.

It is an error to specify both default and default_factory.