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_peaks
that 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.py
functions are simplified to 3 functions:get_xgm()
,align_xgm_array()
andcalibrate_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 theextra_data
DataCollection
and the processedxarray
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 theload
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 filebunch_pattern.py
is not useful and could be removed. - The functions that load TIM and XGM data in DSSC were adapted accordingly
Merge request reports
Activity
Just a note that we know have documentation available at: https://rtd.xfel.eu/projects/scs-toolbox/
To check locally,
make html
in doc folder for example.added 4 commits
-
ad999302...1175e2c9 - 2 commits from branch
master
- 0171b1ec - merging last changes from master
- 8d17208d - Using logging for displaying info
-
ad999302...1175e2c9 - 2 commits from branch
added 1 commit
- 9aad1617 - Changed first arguments of get_peaks() to accept extra_data DataCollection
added 1 commit
- 8d294e9f - Changed arguments of get_tim_peaks and get_fast_adc_peaks to take DataCollection, flake8
added 1 commit
- 8d294e9f - Changed arguments of get_tim_peaks and get_fast_adc_peaks to take DataCollection, flake8
Ideally we would also provide code snippets in the documentation as well as notebook examples.
For the notebook examples, we would want to use data that can be made publicly available, so either some in-house/commissioning data or from a community proposal. Do you have already some ideas ?
added 1 commit
- 6acef7ed - Added get_peak_params to check peak integration, modified get tim and fast adc peaks functions
Here is a notebook to show the new approach to read digitizers and xgm data from community proposals.
added 1 commit
- 55d5b564 - slight change of workflow for get_digitizer_peaks()
Logic diagram of
get_tim_peaks()
:Updated notebook with more tests
Edited by Laurent Mercadieradded 1 commit
- 6d8d9823 - Replaced function to check peak parameters by check_peak_params
added 1 commit
- 49d90944 - Simplify dssc_misc for loading tim and xgm data, remove unused functions in detector __init__.py
added 1 commit
- c96f2810 - Renamed get_fast_adc_peaks to get_laser_peaks, adapted get_digitizer_peaks
mentioned in issue #10 (closed)
added 1 commit
- 7547cd7e - Changed routines __init__.py to make easier import
added 1 commit
- 38037a2f - Adds SA3 bunch pattern table mnemonics and check for it in load function
added 1 commit
- f4709b94 - Simplified calibrate_xgm(), removed unused XGM functions, moved TIM functions...
added 1 commit
- 075ce57e - Updated load doc, small fix for get_digitizer_peaks()
added 1 commit
- 28f65b75 - Added BAM detectors function, added is_pulse_at in bunch_pattern_external
- Resolved by Loïc Le Guyader
- Resolved by Laurent Mercadier
added 1 commit
- a5f89b09 - Fix in doc for load, removed load_run, updated load test and DSSCBinner init accordingly
added 1 commit
- 4117ce65 - Boundary values for find_integ_params, account for corrupted xgm data, check if apd array is valid
added 1 commit
- daa183af - Improved logging messages, harmonized detector functions, added function to...
assigned to @lleguy
added 1 commit
- ec1d87ca - Add bunch pattern arguments for tim and laser in load, update notebook examples
I started a documentation on the
load
function with a Jupyter notebook (thanks @carinanc), please have a look by building the doc. I will continue with improving the documentation but this can also be continued after the merge.- Resolved by Loïc Le Guyader
mentioned in issue #23 (closed)
added 1 commit
- 66f31f1a - Fix notebook link extension from source link
- Resolved by Loïc Le Guyader