From 6d782fd165730978f976a5abbe80471eb2372da6 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Mon, 6 Nov 2023 16:54:05 +0100
Subject: [PATCH] force fixed gain for JF data in burst mode

---
 .../Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
index 3c65015a9..b100cec8a 100644
--- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
+++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
@@ -182,7 +182,14 @@
     "    gain_mode = ctrl_data.get_gain_mode()\n",
     "    print(f\"Gain mode is {gain_mode} ({ctrl_data.run_mode})\")\n",
     "else:\n",
-    "    print(f\"Gain mode is manually set to {gain_mode}.\")"
+    "    print(f\"Gain mode is manually set to {gain_mode}.\")\n",
+    "\n",
+    "# JF corrections in burst mode are only supported when no gain switching occurs.\n",
+    "# Always retrieve fixed gain constant for burst mode.\n",
+    "if gain_mode == 1 and mem_cells > 1:\n",
+    "    print(\"By default fixed gain constant will be retrieved for burst mode data,\"\n",
+    "          \" even for dynamic gain data.\")\n",
+    "    gain_mode = 1"
    ]
   },
   {
-- 
GitLab