From 5be8c9011913235f13aef17e25d2561daa888788 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Thu, 2 Jun 2022 11:28:19 +0200
Subject: [PATCH] add parameter conditions in the first cell

---
 .../Gotthard2/Correction_Gotthard2_NBC.ipynb  | 19 +++++++++----------
 src/cal_tools/gotthard2algs.pyx               |  6 ++----
 src/xfel_calibrate/notebooks.py               |  2 +-
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
index 166d77d04..ee4104f94 100644
--- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
+++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
@@ -43,6 +43,13 @@
     "relative_gain = True  # do relative gain correction\n",
     "constants_file = \"/gpfs/exfel/data/scratch/ahmedk/dont_remove/gotthard2/constants/calibration_constants_GH2.h5\"\n",
     "\n",
+    "# Parameter conditions.\n",
+    "pulses = -1  # Number of detector pulses, -1 to use value in raw file.\n",
+    "bias_voltage = -1  # Detector bias voltage, -1 to use value in raw file.\n",
+    "integration_time = -1  # Detector integration time, -1 to use value in raw file.\n",
+    "acquisition_rate = -1  # Detector acquisition rate, -1 to use value in raw file.\n",
+    "gain_setting = -1  # Detector gain setting (High and Low CDS), -1 to use value in raw file.\n",
+    "\n",
     "# Parameters for plotting\n",
     "skip_plots = False  # exit after writing corrected files\n",
     "pulse_idx_preview = 3 # pulse index to preview. The following even/odd pulse index is used for preview. # TODO: update to pulseId preview.\n",
@@ -168,16 +175,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "# TODO: Retrieve calibration constants from CALCAT"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "531c12e6-1c02-45fc-a7a2-018a08eb7a2d",
-   "metadata": {},
-   "outputs": [],
-   "source": [
+    "# TODO: Retrieve calibration constants from CALCAT\n",
+    "\n",
     "# load constants temporarely using defined local paths.\n",
     "with h5py.File(constants_file, 'r') as cfile:\n",
     "    offset_map = cfile[\"offset_map\"][()]\n",
diff --git a/src/cal_tools/gotthard2algs.pyx b/src/cal_tools/gotthard2algs.pyx
index 21d6daa4c..5a87ff564 100644
--- a/src/cal_tools/gotthard2algs.pyx
+++ b/src/cal_tools/gotthard2algs.pyx
@@ -1,7 +1,4 @@
-import numpy as np
-
-from cython cimport boundscheck, wraparound, cdivision
-cimport numpy as cnp
+from cython cimport boundscheck, cdivision, wraparound
 
 
 @boundscheck(False)
@@ -39,6 +36,7 @@ def correct_train(
     """Correct Gotthard2 raw data.
     1. Offset correction.
     2. Gain correction.
+    3. Mask badpixels.
     """
 
     cdef:
diff --git a/src/xfel_calibrate/notebooks.py b/src/xfel_calibrate/notebooks.py
index 5a831031f..8d44b7cc5 100644
--- a/src/xfel_calibrate/notebooks.py
+++ b/src/xfel_calibrate/notebooks.py
@@ -194,7 +194,7 @@ notebooks = {
     },
     "EPIX100": {
         "DARK": {
-            "notebook": "notebooks/ePix100/Characterize_Darks_ePix100_NBC.ipynb",
+            "notebook": "notebooks/ePix100/Characterize_Darks_ePix100_NBC.ipynb",  # noqa
             "concurrency": {"parameter": None,
                             "default concurrency": None,
                             "cluster cores": 4},
-- 
GitLab