Skip to content

Simplify digitizer functions and pulse ID coordinates assignment for XGM, digitizers

Laurent Mercadier requested to merge digitizers_LM into master

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_peaks that can take any FastADC or ADQ412 data. For convenience, get_tim_peaks() and get_laser_peaks() are special calls to get_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.py functions are simplified to 3 functions: get_xgm(), align_xgm_array() and calibrate_xgm().
  • A new file bam_detectors.py that extracts and aligns any BAM data.
  • useage of the bunch_pattern_external module, with addition of function is_pulse_at()
  • The load function is modified and returns both the extra_data DataCollection and the processed xarray Dataset.
  • Documentation on the new features is started, some of it via a Jupyter notebook.

The consequences are:

  • The sase1, sase3, npulses_sase1, npulses_sase3 arrays in the load function are not required and not loaded anymore.
  • Instead, the bunchPatternTable is 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 file bunch_pattern.py is not useful and could be removed.
  • The functions that load TIM and XGM data in DSSC were adapted accordingly
Edited by Laurent Mercadier

Merge request reports