Skip to content

calcat_interface2: Fix require_calibrations() when none of a given calibration type found

Thomas Kluyver requested to merge fix/require-calibrations into master

Description

When no offset constants are found for a given detector, .require_calibrations() was raising a KeyError, when we expect it to deselect all modules and return an empty CalibrationData object. We have seen this for both LPD & JUNGFRAU.

How Has This Been Tested?

xfel-calibrate jungfrau CORRECT \
  --karabo-da JNGFR01 --receiver-template JNGFR01 \
  --karabo-id MID_EXP_JF500K1 --run 300 \
  --in-folder /gpfs/exfel/exp/MID/202302/p004451/raw \
  --out-folder /gpfs/exfel/data/scratch/kluyvert/jf-corr-p4451-r300

Now fails with an error from the notebook:

Exception: Could not find offset constants for any modules, will not correct data.

A separate fix is likely needed in the JUNGFRAU correction notebook for the fallback to dynamic gain constants, as it's currently catching the wrong error.

Types of changes

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

Checklist:

  • My code follows the code style of this project.

Reviewers

@schmidtp

Merge request reports