From f0d1ff71887292cb73f2b4740a602370d8854f88 Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Wed, 29 Jun 2022 13:00:58 +0200 Subject: [PATCH] retrieve constants from calcat --- .../Gotthard2/Correction_Gotthard2_NBC.ipynb | 1 + src/cal_tools/gotthard2/gotthard2lib.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb index 8368dcb97..b9d190420 100644 --- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb @@ -58,6 +58,7 @@ "pulse_idx_preview = 3 # pulse index to preview. The following even/odd pulse index is used for preview. # TODO: update to pulseId preview.\n", "\n", "\n", + "\n", "def balance_sequences(in_folder, run, sequences, sequences_per_node, karabo_da):\n", " from xfel_calibrate.calibrate import balance_sequences as bs\n", " return bs(in_folder, run, sequences, sequences_per_node, karabo_da)" diff --git a/src/cal_tools/gotthard2/gotthard2lib.py b/src/cal_tools/gotthard2/gotthard2lib.py index 56f20b8bf..f5c431cb0 100644 --- a/src/cal_tools/gotthard2/gotthard2lib.py +++ b/src/cal_tools/gotthard2/gotthard2lib.py @@ -34,6 +34,7 @@ class Gotthard2Ctrl(): def get_exposure_period(self): return(round( self.run_dc[self.ctrl_src, "exposurePeriod"].as_single_value(), 4)) # noqa +<<<<<<< HEAD def get_acquisition_rate(self): if "acquisitionRate.value" in self.run_dc.keys_for_source(self.ctrl_src): # noqa @@ -52,13 +53,25 @@ class Gotthard2Ctrl(): ======= def get_exposure_period(self): return(self.run_dc[self.ctrl_src, "exposurePeriod"].as_single_value()) +======= +>>>>>>> retrieve constants from calcat def get_operation_mode(self): - return( - float(self.run_dc.get_run_value(self.ctrl_src, "operationMode"))) + if "operationMode.value" in self.run_dc.keys_for_source( + self.ctrl_src): + return( + float(self.run_dc.get_run_value( + self.ctrl_src, "operationMode"))) def get_single_photon(self): +<<<<<<< HEAD >>>>>>> add operation mode and single photon return( bool(self.run_dc[self.ctrl_src, "singlePhoton"].as_single_value())) >>>>>>> introduce SinglePhoton and OperationMode +======= + if "singlePhoton.value" in self.run_dc.keys_for_source( + self.ctrl_src): + return( + bool(self.run_dc[self.ctrl_src, "singlePhoton"].as_single_value())) # noqa +>>>>>>> retrieve constants from calcat -- GitLab