gondola.calibration#

Calibration related methods

Functions

load_rb_calibrations(cali_dir[, load_event_data])

Load all calibrations stored in a certain directory and return a dictionary rbid -> RBCalibration

Classes

class gondola.calibration.RBCalibrations#
static assemble_from_flightcal(fcal_t, fcal_v)#

Re-assemble a RBCalibration from chopped up parts

check()#
d_v#
static from_bytestream(bytestream, pos)#
static from_file(filename, discard_data=True)#

Load the calibration from a file with a TofPacket of type RBCalibration in it

# Arguments:

  • filename : File with a TofPacket of type RBCalibration in it

  • discard_data : Throw away event data after loading

static from_random()#
static from_tofpacket(packet)#
nanoseconds(channel, stop_cell)#

Apply the timing calibration to a single channel

This will allocate the array for the waveform time bins (unit is ns)

# Arguments

  • channel : Channel id 1-9

  • stop_cell : This channels stop cell

noi_data#
pack()#

Pack self into a TofPacket to be written on disk or sent over network

passes_timing_checks()#
passes_voltage_checks()#
rb_id#
tbin#
tcal_data#
v_dips#
v_inc#
v_offsets#
vcal_data#
voltages(channel, stop_cell, adc)#

Apply the voltage calibration to a single channel FIXME - mixing of naming conventions for the channels

FIXME - make it return Result<(), CalibrationError>

# Arguments

  • channel : Channel id 1-9

  • stop_cell : This channels stop cell

  • adc : Uncalibrated channel data

  • waveformPre-allocated array to hold

    calibrated waveform data.

gondola.calibration.load_rb_calibrations(cali_dir: Path, load_event_data=False)#

Load all calibrations stored in a certain directory and return a dictionary rbid -> RBCalibration

# Arguments:
  • cali_dir : Path with calibration files, one per RB

# Keyword Arguments:

  • load_event_dataif True, also load the associated events

    which went into the calculation of the calibration constants.