From 4504ed17c842e965049bd1b8d969d50198ce24b8 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Thu, 4 Apr 2024 10:56:19 +0200
Subject: [PATCH] accept non zero value from any module

---
 notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
index b5a01841c..971689cf5 100644
--- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
+++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
@@ -416,22 +416,15 @@
     "    acq_rate = agipd_cond.get_acq_rate()\n",
     "if mem_cells == -1:\n",
     "    mem_cells = agipd_cond.get_num_cells()\n",
-    "if mem_cells is None:\n",
-    "    # TODO FOR MR REVIEWERS:n This check is only useful in case we read mem_cells from fast data instead of slow data.\n",
-    "    # I vote for moving this ValueError to the function instead or we better return None and handle it from the Nb like now?\n",
-    "    raise ValueError(f\"No raw images found for {instrument_src_first_mod}\")\n",
     "# TODO: look for alternative for passing creation_time\n",
     "if gain_setting == -1:\n",
     "    gain_setting = agipd_cond.get_gain_setting(creation_time)\n",
     "if bias_voltage == -1:\n",
-    "    # TODO FOR MR REVIEWERS: Shall I read all bias voltage modules and compare values\n",
-    "    # or could this be adding complications?\n",
-    "    # This comparison would work only in case there is an issue with the detector.\n",
-    "    # Then there is a possibility that the dark constants were injected with\n",
-    "    # different voltage values for each module. If this comparison is not done and this issue is in place\n",
-    "    # We will reach the same detector issue conclusion after realizing constants were not retrieved for all modules.\n",
-    "    bias_voltage = agipd_cond.get_bias_voltage(\n",
-    "        karabo_id_control, module=first_mod_channel)\n",
+    "    for m in modules:\n",
+    "        bias_voltage = agipd_cond.get_bias_voltage(karabo_id_control, module=m)\n",
+    "        # Accept non-zero value for a bias voltage from any module.\n",
+    "        if bias_voltage != 0.:\n",
+    "            break\n",
     "if integration_time == -1:\n",
     "    integration_time = agipd_cond.get_integration_time()\n",
     "if gain_mode == -1:\n",
-- 
GitLab