gondola.calibration#
Calibration related methods
Functions
|
Load all calibrations stored in a certain directory and return a dictionary rbid -> RBCalibration |
Classes
DRS4 calibration routine for the TOF readoutboards. |
|
- class gondola.calibration.RBCalibrations#
DRS4 calibration routine for the TOF readoutboards.
Translate adc per bin to voltage (mV) over time (nanoseconds)
This bascially calibrates the capacitor array of the DRS4 chip and produces a number of calibration constants.
- 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.
- class gondola.calibration.TrackerOnlineCalibration#
- calibrate(hit)#
Fill out the energy field in the tracker hit
FIXME - this panics if the calibration is not loaded properly
- # Arguments:
- hitA tracker hit. This hit will have its
.energy field populated
- static from_default()#
Load the online tracker calibration from the file as it was used in the GAPSI flight.
FIXME - if this fails, we won't know
- static from_file(path)#
- is_pulsed(hit)#
- class gondola.calibration.TrackerOfflineCalibration#
- adc_sig_cut#
- calibrate_hits(hits)#
- gain_map#
- mask_map#
- ped_map#
- ped_sigma_cut#
- plot_transfer_fn(strip_id)#
Plot the transfer function for the respective strip over a reasonable ADC range (0-1600)
- pulse_map#
- remove_cmn#
- remove_pulsed#
- tf_map#
- 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.