From 3afea6779af24e197db94265db4bab144ec431a9 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Wed, 25 Sep 2024 11:15:21 +0200
Subject: [PATCH] feat: update name and datasource to check before testing

---
 .../Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb     | 6 +++---
 .../Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb   | 2 +-
 src/cal_tools/calcat_interface2.py                          | 4 ++--
 src/cal_tools/jungfrau/jungfraulib.py                       | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
index 2437aa08e..84eecdd0e 100644
--- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
+++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
@@ -50,7 +50,7 @@
     "\n",
     "# Parameters for retrieving calibration constants\n",
     "integration_time = -1  # integration time in us. set to -1 to overwrite by value in file.\n",
-    "exposure_timer = -1  # exposure timer in us. set to -1 to overwrite by value in file.\n",
+    "exposure_timer = -1  # exposure timer. set to -1 to overwrite by value in file.\n",
     "gain_setting = -1  # 0 for dynamic gain, 1 for dynamic HG0. set to -1 to overwrite by value in file.\n",
     "gain_mode = -1  # 0 for runs with dynamic gain setting, 1 for fixed gain. Set to -1 to overwrite by value in file.\n",
     "mem_cells = -1  # Set mem_cells to -1 to automatically use the value stored in RAW data.\n",
@@ -177,9 +177,9 @@
     "\n",
     "if exposure_timer < 0:\n",
     "    exposure_timer = ctrl_data.get_exposure_timer()\n",
-    "    print(f\"Exposure timer is {exposure_timer} us\")\n",
+    "    print(f\"Exposure timer is {exposure_timer}\")\n",
     "else:\n",
-    "    print(f\"Exposure timer is manually set to {exposure_timer} us\")\n",
+    "    print(f\"Exposure timer is manually set to {exposure_timer}\")\n",
     "\n",
     "if bias_voltage < 0:\n",
     "    bias_voltage = ctrl_data.get_bias_voltage()\n",
diff --git a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb
index 1b1ef7b30..fca23b403 100644
--- a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb
+++ b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb
@@ -50,7 +50,7 @@
     "\n",
     "# Parameters to be used for injecting dark calibration constants.\n",
     "integration_time = -1  # Integration time in us. Set to -1 to overwrite by value in file.\n",
-    "exposure_timer = -1  # Exposure timer **UNIT**?. Set to -1 to overwrite by value in file.\n",
+    "exposure_timer = -1  # Exposure timer. Set to -1 to overwrite by value in file.\n",
     "gain_setting = -1  # 0 for dynamic, forceswitchg1, forceswitchg2, 1 for dynamichg0, fixgain1, fixgain2. Set to overwrite by value in file.\n",
     "gain_mode = -1  # 1 if medium and low runs are  fixgain1 and fixgain2, otherwise 0. Set to -1 to overwrite by value in file.\n",
     "bias_voltage = -1  # sensor bias voltage in V, will be overwritten by value in file\n",
diff --git a/src/cal_tools/calcat_interface2.py b/src/cal_tools/calcat_interface2.py
index db44d0210..86c3819e0 100644
--- a/src/cal_tools/calcat_interface2.py
+++ b/src/cal_tools/calcat_interface2.py
@@ -1013,7 +1013,7 @@ class JUNGFRAUConditions(ConditionsBase):
     sensor_bias_voltage: float
     memory_cells: int
     integration_time: float
-    exposure_time: float
+    exposure_timer: float
     gain_setting: int
     gain_mode: Optional[int] = None
     sensor_temperature: float = 291
@@ -1026,7 +1026,7 @@ class JUNGFRAUConditions(ConditionsBase):
         "Pixels X",
         "Pixels Y",
         "Integration Time",
-        "Exposure Time",
+        "Exposure Timer",
         "Sensor temperature",
         "Gain Setting",
         "Gain mode",
diff --git a/src/cal_tools/jungfrau/jungfraulib.py b/src/cal_tools/jungfrau/jungfraulib.py
index e602d74a6..1bdc01040 100644
--- a/src/cal_tools/jungfrau/jungfraulib.py
+++ b/src/cal_tools/jungfrau/jungfraulib.py
@@ -82,9 +82,9 @@ class JungfrauCtrl():
         return(float(self.run_dc.get_run_value(
             self.ctrl_src, "exposureTime.value")) * 1e6)
 
-    def get_exposure_time(self) -> float:
-        return(float(self.run_dc.get_run_value(
-            self.ctrl_src, "exposurePeriod.value")) * 1e6)
+    def get_exposure_timer(self) -> float:
+        return(int(self.run_dc.get_run_value(
+            self.ctrl_src, "exposureTimer.value")))
 
     def get_gain_setting(self) -> int:
         """Get run gain settings to identify if run is in
-- 
GitLab