From 5f46de6c02206e880e1e93904e231a794f87de91 Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Fri, 5 Aug 2022 11:12:52 +0200 Subject: [PATCH] last changes after testing with reference runs --- notebooks/ePix100/Correction_ePix100_NBC.ipynb | 2 +- .../ePix100/ePix100_retrieve_constants_precorrection.ipynb | 4 ++-- notebooks/pnCCD/Correct_pnCCD_NBC.ipynb | 2 +- .../pnCCD/pnCCD_retrieve_constants_precorrection.ipynb | 2 -- src/cal_tools/pnccdlib.py | 6 +++--- src/cal_tools/tools.py | 3 ++- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/notebooks/ePix100/Correction_ePix100_NBC.ipynb b/notebooks/ePix100/Correction_ePix100_NBC.ipynb index 35f8c78a4..cad001b9c 100644 --- a/notebooks/ePix100/Correction_ePix100_NBC.ipynb +++ b/notebooks/ePix100/Correction_ePix100_NBC.ipynb @@ -47,7 +47,7 @@ "bias_voltage = 200 # bias voltage\n", "in_vacuum = False # detector operated in vacuum\n", "integration_time = -1 # Detector integration time, Default value -1 to use the value from the slow data.\n", - "fix_temperature = -1 # fixed temperature value in Kelvin, Default value -1 to use the value from files.\n", + "fix_temperature = 290 # fixed temperature value in Kelvin, Default value -1 to use the value from files.\n", "gain_photon_energy = 9.0 # Photon energy used for gain calibration\n", "photon_energy = 0. # Photon energy to calibrate in number of photons, 0 for calibration in keV\n", "\n", diff --git a/notebooks/ePix100/ePix100_retrieve_constants_precorrection.ipynb b/notebooks/ePix100/ePix100_retrieve_constants_precorrection.ipynb index d4ee5826b..591d3b842 100644 --- a/notebooks/ePix100/ePix100_retrieve_constants_precorrection.ipynb +++ b/notebooks/ePix100/ePix100_retrieve_constants_precorrection.ipynb @@ -37,7 +37,7 @@ "# Conditions for retrieving calibration constants.\n", "bias_voltage = 200 # bias voltage\n", "in_vacuum = False # detector operated in vacuum\n", - "fix_temperature = -1 # fixed temperature value in Kelvin. Default value -1 to use the value from files.\n", + "fix_temperature = 290 # fixed temperature value in Kelvin. Default value -1 to use the value from files.\n", "integration_time = -1 # Detector integration time, Default value -1 to use the value from the slow data.\n", "gain_photon_energy = 9.0 # Photon energy used for gain calibration\n", "\n", @@ -97,7 +97,7 @@ "metadata": {}, "outputs": [], "source": [ - "creation_time = calcat_creation_time(in_folder, run, \"2019-07-04 11:02:41\")\n", + "creation_time = calcat_creation_time(in_folder, run, creation_time)\n", "print(f\"Using {creation_time.isoformat()} as creation time\")" ] }, diff --git a/notebooks/pnCCD/Correct_pnCCD_NBC.ipynb b/notebooks/pnCCD/Correct_pnCCD_NBC.ipynb index 01421b972..b479ac76a 100644 --- a/notebooks/pnCCD/Correct_pnCCD_NBC.ipynb +++ b/notebooks/pnCCD/Correct_pnCCD_NBC.ipynb @@ -341,7 +341,7 @@ "\n", "if const_yaml: # Used while reproducing corrected data.\n", " print(f\"Using stored constants in {metadata.filename}\")\n", - " constants, when = read_const_yaml(\n", + " constants, when = load_specified_constants(\n", " const_yaml[karabo_da][\"constants\"], empty_constants\n", " )\n", "else:\n", diff --git a/notebooks/pnCCD/pnCCD_retrieve_constants_precorrection.ipynb b/notebooks/pnCCD/pnCCD_retrieve_constants_precorrection.ipynb index 01e8a6573..eeac52fe3 100644 --- a/notebooks/pnCCD/pnCCD_retrieve_constants_precorrection.ipynb +++ b/notebooks/pnCCD/pnCCD_retrieve_constants_precorrection.ipynb @@ -136,8 +136,6 @@ " gain = ctrl_data.get_gain()\n", "if fix_temperature_top == 0:\n", " fix_temperature_top = ctrl_data.get_fix_temperature_top()\n", - "if fix_temperature_bot == 0:\n", - " fix_temperature_bot = ctrl_data.get_fix_temperature_bot()\n", "\n", "# Printing the Parameters Read from the Data File:\n", "display(Markdown(\"### Detector Parameters\"))\n", diff --git a/src/cal_tools/pnccdlib.py b/src/cal_tools/pnccdlib.py index 4a9c298ca..98594427e 100644 --- a/src/cal_tools/pnccdlib.py +++ b/src/cal_tools/pnccdlib.py @@ -24,9 +24,9 @@ class PnccdCtrl(): self.mdl_src_temp = f"{karabo_id}/MDL/{{}}" def get_bias_voltage(self): - # Convert the high float precision is not needed. - return(int(abs(self.run_dc.get_run_value( - self.mdl_src_temp.format("DAQ_MPOD"), "u0voltage.value")))) + return( + abs(self.run_dc.get_run_value( + self.mdl_src_temp.format("DAQ_MPOD"), "u0voltage.value"))) def get_gain(self): return( diff --git a/src/cal_tools/tools.py b/src/cal_tools/tools.py index 6589a5977..cf8443dba 100644 --- a/src/cal_tools/tools.py +++ b/src/cal_tools/tools.py @@ -963,7 +963,8 @@ def load_specified_constants( const_data[cname] = np.copy( cf[f"{mdata['dataset-name']}/data"]) else: - const_data[cname] = empty_constants[cname] if empty_constants else None # noqa + const_data[cname] = ( + empty_constants[cname] if empty_constants else None) return const_data, when -- GitLab