From 8269718f5a251c47c135538a464dd94cfccffd50 Mon Sep 17 00:00:00 2001
From: Cyril Danilevski <cyril.danilevski@xfel.eu>
Date: Wed, 20 Oct 2021 13:28:16 +0200
Subject: [PATCH] Fix formatting of filename in Jungfrau dark notebook

---
 .../Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 ecf2ee823..a63b7ec0b 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
@@ -206,7 +206,8 @@
     "        if mod not in noise_map:\n",
     "            if not manual_slow_data:\n",
     "                run_path = h5path_run.format(karabo_id_control, receiver_control_id)\n",
-    "                with h5py.File(fp_path.format(0), 'r') as f:\n",
+    "                filename = fp_path.format(0)\n",
+    "                with h5py.File(filename, 'r') as f:\n",
     "                    integration_time = float(f[f'{run_path}/exposureTime/value'][()]*1e6)\n",
     "                    bias_voltage = int(np.squeeze(f[f'{run_path}/vHighVoltage/value'])[0])\n",
     "                    if r_n == run_high:\n",
@@ -215,7 +216,7 @@
     "                        except KeyError:\n",
     "                            print(\n",
     "                                \"ERROR: gain_setting is not available for h5 ctrl path \"\n",
-    "                                f\"/RUN/{karabo_id_control}/DET/CONTROL/settings/value,\\nfor file: {fp_path}. \\n\"\n",
+    "                                f\"/RUN/{karabo_id_control}/DET/CONTROL/settings/value,\\nfor file: {filename}. \\n\"\n",
     "                                \"WARNING: Setting gain_setting to 0, assuming that this is an old run.\\n\")\n",
     "                            gain_s = \"KeyError\"\n",
     "                        gain_setting = 1 if gain_s == \"dynamichg0\"  else 0\n",
-- 
GitLab