Reset calibration_metadata.yml before saving the initial calibration metadata
There was a reported issue for multiple dark processing that the second dark request for AGIPD fails.
I faced the same issue last days while testing for our next deployment for LPD, DSSC and AGIPD.
Description
When there is a dark request we create a new calibration_metadata.yml file. At the end of DSSC, LPD and AGIPD dark processing a key for modules-mapping
is added by Overallmodules_darks_summary notebook.
After reprocessing again the same run using the same out-folder the calibration_metadata.yml file is not created properly.
https://git.xfel.eu/detectors/pycalibration/-/blob/master/src/xfel_calibrate/calibrate.py#L659
I don't really understand why this issue happening even though we are using "w"
while create the yml file.
https://git.xfel.eu/detectors/pycalibration/-/blob/master/src/cal_tools/tools.py#L794
This is just a fix to reset the file and save the empty initialized dict before saving the metadata from calibrate.py
. Until I understand more why this happens.
How Has This Been Tested?
Relevant Documents (optional)
I have added the malformed yml files. Line 84 is the line with the issue.
Types of changes
Checklist:
-
Add a comment pointing to this discussion before merging