From d6ce3d526e867974f4d9d84231a891123dfdfee5 Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Thu, 1 Sep 2022 10:14:23 +0200 Subject: [PATCH] use as_single_value for temperature --- notebooks/ePix100/Correction_ePix100_NBC.ipynb | 2 +- src/cal_tools/epix100/epix100lib.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/notebooks/ePix100/Correction_ePix100_NBC.ipynb b/notebooks/ePix100/Correction_ePix100_NBC.ipynb index cad001b9c..35f8c78a4 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 = 290 # fixed temperature value in Kelvin, Default value -1 to use the value from files.\n", + "fix_temperature = -1 # 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/src/cal_tools/epix100/epix100lib.py b/src/cal_tools/epix100/epix100lib.py index ee501960d..19a196178 100644 --- a/src/cal_tools/epix100/epix100lib.py +++ b/src/cal_tools/epix100/epix100lib.py @@ -22,5 +22,8 @@ class epix100Ctrl(): self.ctrl_src, 'expTime.value'].as_single_value(reduce_by='first') def get_temprature(self): - return self.run_dc[ - self.instrument_src, 'data.backTemp'].ndarray().mean() / 100 + temp = self.run_dc[ + self.instrument_src, 'data.backTemp'].as_single_value( + reduce_by='mean', rtol=1) / 100 + + return temp[0] if hasattr(temp, '__len__') else temp -- GitLab