From d0ae766681f29aca43f1feb1cc2398f0950706ae Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Fri, 17 Nov 2023 17:27:05 +0100
Subject: [PATCH] return jf_cal as well

---
 .../Jungfrau_Gain_Correct_and_Verify_NBC.ipynb       | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
index 7913c657b..2ae33c6ea 100644
--- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
+++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
@@ -222,7 +222,7 @@
     "    jf_metadata = jf_cal.metadata(calibrations=constant_names) \n",
     "    # Display retrieved calibration constants timestamps\n",
     "    jf_cal.display_markdown_retrieved_constants(metadata=jf_metadata)\n",
-    "    return jf_metadata\n",
+    "    return jf_cal, jf_metadata\n",
     "\n",
     "def force_fixed_gain_constants():\n",
     "    \"\"\"JF corrections in burst mode are only supported when\n",
@@ -239,14 +239,14 @@
     "    from cal_tools.calcat_interface import CalCatError\n",
     "\n",
     "    try:\n",
-    "        jf_metadata = jungfrau_cal_mdata(gm=1)\n",
+    "        jf_cal, jf_metadata = jungfrau_cal_mdata(gm=1)\n",
     "    except CalCatError as e:\n",
     "        warning(\n",
     "            \"No fixed gain constants found. \"\n",
     "            \"Looking for dynamic gain constant. \"\n",
     "            f\"(CalCatError: {e}.\")\n",
     "\n",
-    "    jf_metadata = jungfrau_cal_mdata(gm=0)\n",
+    "    jf_cal, jf_metadata = jungfrau_cal_mdata(gm=0)\n",
     "\n",
     "    for mod, ccvs in jf_metadata.items():\n",
     "        offset = ccvs.get(\"Offset10Hz\")\n",
@@ -260,7 +260,7 @@
     "                \" Please make sure there are available constants.\")\n",
     "            jf_metadata[mod].pop(\"Offset10Hz\")\n",
     "\n",
-    "    return jf_metadata"
+    "    return jf_cal, jf_metadata"
    ]
   },
   {
@@ -279,9 +279,9 @@
    "outputs": [],
    "source": [
     "if force_fixed_gain_constants_flag:\n",
-    "    jf_metadata = force_fixed_gain_constants()\n",
+    "    jf_cal, jf_metadata = force_fixed_gain_constants()\n",
     "else:\n",
-    "    jf_metadata = jungfrau_cal_mdata(gain_mode)"
+    "    jf_cal, jf_metadata = jungfrau_cal_mdata(gain_mode)"
    ]
   },
   {
-- 
GitLab