Fix fail on reinjection of constants for dynamic flat-field correction
Description
This suppresses the reinjection exception for Offsets and DynamicFF constants because operators uses the same dark multiple times to generate constants.
How Has This Been Tested?
Hotfixed in production
Relevant Documents (optional)
Exception traceback
---------------------------------------------------------------------------
CCVAlreadyInjectedError Traceback (most recent call last)
Cell In[6], line 23
15 ccv_root = write_ccv(
16 tempf.name,
17 pdu['physical_name'], pdu['uuid'], pdu['detector_type']['name'],
18 constant_name, conditions, constant['creation_time'],
19 proposal, [dark_run, flat_run],
20 constant["data"], constant['dims'])
22 if db_output:
---> 23 inject_ccv(tempf.name, ccv_root, metadata_folder)
25 if local_output:
26 ofile = f"{out_folder}/const_{constant_name}_{db_module}.h5"
File ~/deployments/development/git.xfel.eu/detectors/pycalibration/pycalibration-2024-
↪→11-13-3.15.3-188b319/src/cal_tools/constants.py:283, in inject_ccv(const_src, ccv_
↪→root, report_to)
278 # TODO: Remove this when the new injection code is added.
279 if (
280 resp['status_code'] == 422 and
281 "taken" in resp['app_info'].get("begin_at", [""])[0]
282 ):
--> 283 raise CCVAlreadyInjectedError
284 else:
285 raise RuntimeError(resp)
CCVAlreadyInjectedError:
Types of changes
- Bug fix (non-breaking change which fixes an issue)