From ab771928d1cc629feae98639b67ca6d5a33e08fc Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Thu, 30 Nov 2023 14:06:40 +0100 Subject: [PATCH] Add some fixes while testing GH2 correction and dark --- notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb | 12 ++++++++++-- src/cal_tools/calcat_interface.py | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb index 2486a3d7f..d28fe59b6 100644 --- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb @@ -28,12 +28,18 @@ "The same result would be reached in case the needed dark calibration constants were not retrieved for all modules and `offset_correction` is True.\n", "In case one of the gain constants were not retrieved `gain_correction` is switched to False and gain correction is disabled.\n", "\n", - "The `data` datasets stored in the RECEIVER source along with the corrected image (`adc`) and `mask` are: \n", + "The `data` datasets stored in the RECEIVER source along with the corrected image (`adc`) and `mask` are:\n", + "\n", " - `gain`\n", + "\n", " - `bunchId`\n", + "\n", " - `memoryCell`\n", + "\n", " - `frameNumber`\n", + "\n", " - `timestamp`\n", + "\n", " - `trainId`" ] }, @@ -275,6 +281,8 @@ " constant_names += [\"RelativeGainGotthard2\", \"BadPixelsFFGotthard2\"]\n", "\n", " g2_metadata = g2_cal.metadata(calibrations=constant_names)\n", + " # Display retrieved calibration constants timestamps\n", + " g2_cal.display_markdown_retrieved_constants(metadata=g2_metadata)\n", "\n", " # Validate the constants availability and raise/warn correspondingly.\n", " for mod, calibrations in g2_metadata.items():\n", @@ -381,7 +389,7 @@ " data_corr[index, ...],\n", " mask[index, ...],\n", " g,\n", - " const_data[mod][\"OffsetGotthard2\"],\n", + " const_data[mod][\"OffsetGotthard2\"].astype(np.float32), # PSI map is in f8\n", " const_data[mod][\"RelativeGainGotthard2\"], \n", " const_data[mod][\"Mask\"],\n", " apply_offset=offset_correction,\n", diff --git a/src/cal_tools/calcat_interface.py b/src/cal_tools/calcat_interface.py index db67afc90..b6fae3384 100644 --- a/src/cal_tools/calcat_interface.py +++ b/src/cal_tools/calcat_interface.py @@ -1361,7 +1361,8 @@ class GOTTHARD2_CalibrationData(CalibrationData): """Calibration data for the Gotthard II detector.""" calibrations = { - "LUTGotthard2" "OffsetGotthard2", + "LUTGotthard2", + "OffsetGotthard2", "NoiseGotthard2", "BadPixelsDarkGotthard2", "RelativeGainGotthard2", -- GitLab