[AGIPD][CORRECT] Reordering Correction Steps
SUMMARY:
This MR is related to discussions on : https://git.xfel.eu/gitlab/detectors/calibration_workshop/issues/122
Currently, we are applying common-mode correction right after we apply all AGIPD image-wise corrections. This should not be the case as we corrections should be applied in the order of Offset
>Base-line Shift
>Common-mode
>Gain corrections
This MR introduces:
1- Separate functions for offset correct, baseline shift and sharedmem arrays for shared variables between correction functions.
2- Small fixes for running proper xfel-calibrate CLI (notebook
dependency, setting gain-setting to 0 if not found, ...)
TESTS:
- Running notebooks:
The corrected output of the MR was validated by checking the fact that the corrected data is the same after applying Offset
+baseline-shift-stripes
+Common-mode
compared to the old implementation.
using np.allclose()
over:
-
"/INSTRUMENT/MID_DET_AGIPD1M-1/DET/{n_channel}CH0:xtdf/image/data"
-
"/INSTRUMENT/MID_DET_AGIPD1M-1/DET/{n_channel}CH0:xtdf/image/blShift"
- xfel-calibrate CLI:
xfel-calibrate AGIPD CORRECT \
--slurm-mem 750 \
--karabo-da -1 \
--receiver-id {}CH0 \
--karabo-id-control MID_IRU_AGIPD1M1 \
--karabo-da-control AGIPD1MCTRL00 \
--h5path-ctrl /CONTROL/{}/MDL/FPGA_COMP_TEST \
--overwrite \
--sequences-per-node 1 \
--in-folder /gpfs/exfel/exp/MID/202030/p900137/raw \
--out-folder /gpfs/exfel/data/scratch/ahmedk/test/AGIPD_MID-pc \
--karabo-id MID_DET_AGIPD1M-1 \
--run 449 \
--force-hg-if-below \
--force-mg-if-below \
--low-medium-gap \
--zero-nans \
--sequences 0,1,2 \
--rel-gain \
--common-mode \
--blc-stripes