Skip to content

Fail dark processing if a run consist of no images

Karim Ahmed requested to merge fix/dark_processing_empty_runs into master

As reported by @jola

It looks like the code does not care how many images are in the run. It is happy to proceed with "calculations" even the file is empty. At the end, injects constants to DB. I would like to ask you to fix this bug. It has to be possible to set minimum number of trains which are required to calculate the constants and the code should check this requirement for each run before going to the next step.. An example report you can find: http://max-exfl016.desy.de:8008//gpfs/exfel/d/cal/caldb_store/xfel/reports/HED/HED_DET_AGIPD500K2G/dark/dark_900228_r106_r107_r108_210813_171902.pdf

In this case run 106 (HG dark) was empty. I had to deactivate the constants manually in Calcat to be able to correct some runs.

Description

This fixes the reported bug by raising a ValueError in case of having a dark run with no images.

Unfortunately, implementing a check for dark processing the available number of trains is not a part of this fix. Because this is already a part of the new features coming along EXtra-data updates.

How Has This Been Tested?

xfel-calibrate agipd DARK \
--cal-db-interface tcp://max-exfl016:8015#8044 \
--concurrency-par karabo_da \
--karabo-da AGIPD00 AGIPD01 AGIPD02 AGIPD03 AGIPD04 AGIPD05 AGIPD06 AGIPD07 \
--receiver-id {}CH0 --karabo-id-control HED_EXP_AGIPD500K2G \
--karabo-da-control AGIPD500K2G00 --h5path-ctrl /CONTROL/{}/MDL/FPGA_COMP \
--mem-cells 0 --thresholds-offset-hard 0 0 --thresholds-offset-hard-hg 3500 9000 \
--thresholds-offset-hard-mg 3500 9000 --thresholds-offset-hard-lg 3500 9000 \
--in-folder /gpfs/exfel/exp/HED/202131/p900228/raw \
--out-folder /gpfs/exfel/data/scratch/ahmedk/test/agipd_dark_test \
--karabo-id HED_DET_AGIPD500K2G --operation-mode ADAPTIVE_GAIN \
--run-high 106 --run-med 107 --run-low 108

Relevant Documents (optional)

AGIPDCharacterizeDarkImages.pdf

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.

Reviewers

@calibration

Edited by Karim Ahmed

Merge request reports