From 4f114cfdd5d1592f071753b2fd19b5fd54ba81bb Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas.kluyver@xfel.eu>
Date: Mon, 9 Jan 2023 14:31:08 +0100
Subject: [PATCH] Make injecting memory cell order condition optional

---
 notebooks/LPD/LPDChar_Darks_NBC.ipynb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/notebooks/LPD/LPDChar_Darks_NBC.ipynb b/notebooks/LPD/LPDChar_Darks_NBC.ipynb
index b9cb5083e..3aabca084 100644
--- a/notebooks/LPD/LPDChar_Darks_NBC.ipynb
+++ b/notebooks/LPD/LPDChar_Darks_NBC.ipynb
@@ -57,6 +57,7 @@
     "ntrains = 100 # number of trains to use\n",
     "high_res_badpix_3d = False # plot bad-pixel summary in high resolution\n",
     "test_for_normality = False # permorm normality test\n",
+    "inject_cell_order = True  # Include memory cell order as part of the detector condition\n",
     "operation_mode = ''  # Detector operation mode, optional"
    ]
   },
@@ -398,7 +399,10 @@
     "        qm_db = qm_dict[qm]\n",
     "        karabo_da = qm_db[\"karabo_da\"]\n",
     "        cellid_pattern = cellid_patterns_g[cap][qm]\n",
-    "        mem_cell_order = \",\".join([str(c) for c in cellid_pattern]) + \",\"\n",
+    "        if inject_cell_order:\n",
+    "            mem_cell_order = \",\".join([str(c) for c in cellid_pattern]) + \",\"\n",
+    "        else:\n",
+    "            mem_cell_order = None\n",
     "\n",
     "        condition = Conditions.Dark.LPD(memory_cells=max_cells,\n",
     "                                        bias_voltage=bias_voltage,\n",
@@ -484,7 +488,10 @@
     "        karabo_da = qm_dict[qm][\"karabo_da\"]\n",
     "        db_module = qm_dict[qm][\"db_module\"]\n",
     "        cellid_pattern = cellid_patterns_g[cap][qm]\n",
-    "        mem_cell_order = \",\".join([str(c) for c in cellid_pattern]) + \",\"\n",
+    "        if inject_cell_order:\n",
+    "            mem_cell_order = \",\".join([str(c) for c in cellid_pattern]) + \",\"\n",
+    "        else:\n",
+    "            mem_cell_order = None\n",
     "\n",
     "        # Do not store empty constants\n",
     "        # In case of 0 trains data_g is initiated with nans and never refilled.\n",
-- 
GitLab