calix.common.cadc.RampOffsetCalib

class calix.common.cadc.RampOffsetCalib(target: int = 20, dynamic_range_min: int = 70)

Bases: calix.common.base.Calib

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

This is done by setting the current onto the ramp high and searching the ramp start voltage such that the given minimum of the dynamic range reads the given target value at the CADCs.

This class implements configure and measure functions required by a calibration algorithm to run. Calling run on the calibration does the necessary preconfiguring and uses the given algorithm to find suitable parameters.

Requirements: * All CADC channels are connected to the CADC debug line (can be

achieved with cadc_helpers.configure_chip()).

  • CADC debug line connected to CapMem cell stp_v_charge_0 (can be archived with cadc_helpers.configure_readout_cadc_debug())

Variables

dynamic_range_min – Lower end of the desired dynamic range of the CADCs. Given in CapMem LSB. The voltage is configured as stp_v_charge_0, which is connected to the CADCs via the CapMem debug readout.

__init__(target: int = 20, dynamic_range_min: int = 70)
Parameters

dynamic_range_min – Lower end of the desired dynamic range of the CADCs. Given in LSB of a global CapMem cell.

Methods

__init__([target, dynamic_range_min])

param dynamic_range_min

Lower end of the desired dynamic range

configure_parameters(builder, parameters)

Set CapMem cells cadc_v_ramp_offset of each quadrant to the values given in the array.

measure_results(connection, builder)

Read all CADC channels.

prelude(connection)

Function to preconfigure CapMem parameters for the calibration runs.

configure_parameters(builder: calix.common.base.WriteRecordingPlaybackProgramBuilder, parameters: numpy.ndarray)calix.common.base.WriteRecordingPlaybackProgramBuilder

Set CapMem cells cadc_v_ramp_offset of each quadrant to the values given in the array. :param builder: Builder to append configuring instructions. :param parameters: Array of ramp start voltages to be configured.

Returns

Builder with configuration instructions appended.

measure_results(connection: pyhxcomm_vx.ConnectionHandle, builder: calix.common.base.WriteRecordingPlaybackProgramBuilder)numpy.ndarray

Read all CADC channels. Compute means of quadrants and return those.

Parameters
  • connection – Connection to read CADCs with.

  • builder – Builder to append read instructions to before executing it.

Returns

Array with mean CADC reads of each quadrant.

prelude(connection: pyhxcomm_vx.ConnectionHandle)None

Function to preconfigure CapMem parameters for the calibration runs. Sets the ramp slope current high and the common voltage applied to all CADC channels to the lower end of the specified dynamic range. This reference voltage is set via the cell stp_v_charge_0 that has to be connected to the CapMem debug output.

Parameters

connection – Connection to the chip to calibrate.