Simplify digitizer functions and pulse ID coordinates assignment for XGM, digitizers
Involved: @lleguy @gortr @mercurio
The aim is to clarify/simplify the code for data extraction of point detectors (pulse-resolved data that produces one value per pulse, such as digitizer peaks, XGM, BAM values). The detectors should each have a simple function get_xgm(), get_bam(), get_tim_peaks(), etc, that extracts the relevant values and aligns the pulse ID according to the bunch pattern table. Eventually, these functions should be run in the load function.
The new features are:
- A new file digitizers.py, with one general function
get_digitizers_peaksthat can take any FastADC or ADQ412 data. For convenience,get_tim_peaks()andget_laser_peaks()are special calls toget_digitizers_peaks, tailored for SCS data. The peaks are loaded from peak-integrated values by the digitizer or automatically detected from raw traces and the bunchpattern is used to assign pulse ID. - Possibility to get / visually inspect the peak-integration parameters of the digitizer parameters or the peak finding algorithm results with
check_peaks_params - The
xgm.pyfunctions are simplified to 3 functions:get_xgm(),align_xgm_array()andcalibrate_xgm(). - A new file
bam_detectors.pythat extracts and aligns any BAM data. - useage of the bunch_pattern_external module, with addition of function
is_pulse_at() - The
loadfunction is modified and returns both theextra_dataDataCollectionand the processedxarrayDataset. - Documentation on the new features is started, some of it via a Jupyter notebook.
The consequences are:
- The
sase1,sase3,npulses_sase1,npulses_sase3arrays in theloadfunction are not required and not loaded anymore. - Instead, the
bunchPatternTableis loaded by default, to speed up each of these new functions (currently they each load the bunch pattern table). - The function
extractBunchPattern, and, in general, the filebunch_pattern.pyis not useful and could be removed. - The functions that load TIM and XGM data in DSSC were adapted accordingly
Edited by Laurent Mercadier