From 1c824d4696813b8ce8baf922043edd57fad2698d Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Thu, 24 Mar 2022 07:15:09 +0100
Subject: [PATCH] separate header and new plots changes from this MR

---
 ...Jungfrau_Gain_Correct_and_Verify_NBC.ipynb | 84 ++++++-------------
 1 file changed, 25 insertions(+), 59 deletions(-)

diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
index cc1fc79d8..4a8438abe 100644
--- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
+++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb
@@ -242,7 +242,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Retrieving calibration constants"
+    "### Retrieving calibration constants ###"
    ]
   },
   {
@@ -477,7 +477,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Correcting RAW data"
+    "### Correcting RAW data ###"
    ]
   },
   {
@@ -572,7 +572,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Processing time summary"
+    "### Processing time summary ###"
    ]
   },
   {
@@ -660,6 +660,15 @@
     "gain = jf_raw.get_array(\"data.gain\")[:, :, cell_idx_preview, ...].values"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Single Train Preview ###\n",
+    "\n",
+    "A single image from the first train"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -689,13 +698,6 @@
     "    cb.set_label(\"Counts\")"
    ]
   },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Signal vs Gain Bit Value"
-   ]
-  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -722,7 +724,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## RAW Preview"
+    "### Mean RAW Preview ###\n",
+    "\n",
+    "The per pixel mean of the sequence file of RAW data"
    ]
   },
   {
@@ -731,7 +735,6 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "display(Markdown((f\"### The per pixel mean of sequence {first_seq} of the RAW data\")))\n",
     "fig = plt.figure(figsize=(18, 20))\n",
     "ax = fig.add_subplot(111)\n",
     "raw_mean = np.mean(raw, axis=1)\n",
@@ -746,32 +749,13 @@
     "plt.show()"
    ]
   },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "display(Markdown((f\"### A single image from train {tid}\")))\n",
-    "\n",
-    "fig = plt.figure(figsize=(18, 20))\n",
-    "ax = fig.add_subplot(111)\n",
-    "geom.plot_data_fast(\n",
-    "    raw_train,\n",
-    "    ax=ax,\n",
-    "    vmin=min(0.75*np.median(raw_train[raw_train > 0]), 2000),\n",
-    "    vmax=max(1.5*np.median(raw_train[raw_train > 0]), 16000),\n",
-    "    cmap=\"jet\",\n",
-    "    colorbar={'shrink': 0.5, 'pad': 0.02}\n",
-    ")\n",
-    "plt.show()"
-   ]
-  },
   {
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## CORRECTED Preview"
+    "### Mean CORRECTED Preview ###\n",
+    "\n",
+    "The per pixel mean of the sequence file of CORR data"
    ]
   },
   {
@@ -780,8 +764,6 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "display(Markdown((f\"### The per pixel mean of sequence {first_seq} of the CORR data\")))\n",
-    "\n",
     "fig = plt.figure(figsize=(20, 25))\n",
     "ax = fig.add_subplot(111)\n",
     "corrected_mean = np.mean(corrected, axis=1)\n",
@@ -862,7 +844,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Maximum GAIN Preview"
+    "### Maximum GAIN Preview ###\n",
+    "\n",
+    "The per pixel maximum of the first train of the GAIN data"
    ]
   },
   {
@@ -889,8 +873,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Bad Pixels\n",
-    "\n",
+    "## Bad Pixels ##\n",
     "The mask contains dedicated entries for all pixels and memory cells as well as all three gains stages. Each mask entry is encoded in 32 bits as:"
    ]
   },
@@ -913,7 +896,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Single Image Bad Pixels"
+    "### Single Image Bad Pixels ###\n",
+    "\n",
+    "A single image bad pixel map for the first image of the first train"
    ]
   },
   {
@@ -935,25 +920,6 @@
     ")\n",
     "plt.show()"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "display(Markdown(f\"#### Bad pixels fraction for cellId {sc_start} across sequence {first_seq}\"))\n",
-    "\n",
-    "fig = plt.figure(figsize=(18, 20))\n",
-    "ax = fig.add_subplot(111)\n",
-    "geom.plot_data_fast(\n",
-    "    np.mean(mask>0, axis=1),\n",
-    "    ax=ax,\n",
-    "    vmin=0, vmax=1, cmap=\"jet\",\n",
-    "    colorbar={'shrink': 0.5, 'pad': 0.02},\n",
-    ")\n",
-    "plt.show()"
-   ]
   }
  ],
  "metadata": {
-- 
GitLab