From fcb29e28d7358fc211ef1b3e42ae02eff26abce7 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Mon, 15 Jul 2024 09:10:56 +0200
Subject: [PATCH] feat: use calcat_creation_time instead of
 get_dir_creation_date

---
 ...Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb | 9 ++++-----
 1 file changed, 4 insertions(+), 5 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 5b4a46400..81a1aa6e6 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
@@ -47,6 +47,7 @@
     "min_trains = 100  # Minimum number of trains to process dark constants. Raise a warning if the run has fewer trains.\n",
     "manual_slow_data = False  # if true, use manually entered bias_voltage and integration_time values\n",
     "time_limits = 0.025  # to find calibration constants later on, the integration time is allowed to vary by 0.5 us\n",
+    "creation_time = \"\"  # To overwrite the measured creation_time. Required Format: YYYY-MM-DD HR:MN:SC e.g. \"2022-06-28 13:00:00\"\n",
     "\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",
@@ -94,7 +95,7 @@
     "from cal_tools.jungfrau import jungfraulib\n",
     "from cal_tools.enums import BadPixels, JungfrauGainMode\n",
     "from cal_tools.tools import (\n",
-    "    get_dir_creation_date,\n",
+    "    calcat_creation_time,\n",
     "    get_pdu_from_db,\n",
     "    get_random_db_interface,\n",
     "    get_report,\n",
@@ -121,10 +122,8 @@
     "    JungfrauGainMode.FORCE_SWITCH_HG1.value, JungfrauGainMode.FORCE_SWITCH_HG2.value]\n",
     "old_fixed_settings = [\"fixgain1\", \"fixgain2\"]\n",
     "\n",
-    "creation_time = None\n",
-    "if use_dir_creation_date:\n",
-    "    creation_time = get_dir_creation_date(in_folder, run_high)\n",
-    "    print(f\"Using {creation_time} as creation time\")\n",
+    "creation_time = calcat_creation_time(in_folder, run_high, creation_time)\n",
+    "print(f\"Using {creation_time} as creation time\")\n",
     "os.makedirs(out_folder, exist_ok=True)\n",
     "\n",
     "cal_db_interface = get_random_db_interface(cal_db_interface)\n",
-- 
GitLab