[LPD] [Dark] Cope better with quirks of parallel gain data
Description
Dark processing for p6936 r52 failed because of oddities of parallel gain mode.
- As FXE told us the other day, the last frame in each gain stage often goes funny, and in r52 this put one cell from each train into the wrong gain stages.
- This MR introduces a parameter to drop the last N frames in each gain stage (default 1).
- One module (LPD02) was not using the same cell order in every train. This could affect constant quality, and if the first train we look at had the 'wrong' train order it would also inject with the wrong conditions.
- The MR identifies the most common cell order in the run, checks that that is > 50% of the trains, and discards trains with other orders.
- Even beyond the last frame, some frames have pixels in the wrong gain stage. Especially LPD02 has blocks of frames with all pixels in the wrong gain.
- The MR ignores frames where more than a set percentage of pixels are in the wrong gain (20%, configurable), and checks that we still have some data for each cell.
How Has This Been Tested?
Re-run on the affected run:
xfel-calibrate lpd DARK \
--concurrency-par karabo_da \
--karabo-da LPD00 LPD01 LPD02 LPD03 LPD04 LPD05 LPD06 LPD07 LPD08 LPD09 LPD10 LPD11 LPD12 LPD13 LPD14 LPD15 \
--mem-cells 512 --modules 0-16 \
--in-folder /gpfs/exfel/exp/FXE/202405/p006936/raw --run 52 \
--out-folder /gpfs/exfel/data/scratch/kluyvert/lpd-dark-p6936-r52 \
--karabo-id FXE_DET_LPD1M-1 --operation-mode LPD_PARALLEL_GAIN
All jobs finished successfully, and the memory cell order found for LPD02 is the same as that for LPD00.
Relevant Documents (optional)
/gpfs/exfel/data/scratch/kluyvert/lpd-dark-p6936-r52/FXE_DET_LPD1M-1-DARK-241114_143404.555796.pdf
Types of changes
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- New parameters
Checklist:
- My code follows the code style of this project.