From dc9883f352824330676fba833d735b58a3f3094c Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Mon, 15 Jan 2024 12:50:15 +0100 Subject: [PATCH] update vmin and vmax calculation for Jungfrau correct --- .../Jungfrau_Gain_Correct_and_Verify_NBC.ipynb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb index 2cbf28839..fbbbd563a 100644 --- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb @@ -834,11 +834,12 @@ "\n", "fig, ax = plt.subplots(figsize=(18, 10))\n", "raw_mean = np.mean(raw, axis=1)\n", + "vmin, vmax = np.percentile(raw_mean, [5, 95])\n", "geom.plot_data_fast(\n", " raw_mean,\n", " ax=ax,\n", - " vmin=min(0.75*np.median(raw_mean[raw_mean > 0]), 2000),\n", - " vmax=max(1.5*np.median(raw_mean[raw_mean > 0]), 16000),\n", + " vmin=vmin,\n", + " vmax=vmax,\n", " cmap=\"jet\",\n", " colorbar={'shrink': 1, 'pad': 0.01},\n", ")\n", @@ -863,12 +864,9 @@ "\n", "fig, ax = plt.subplots(figsize=(18, 10))\n", "corrected_mean = np.mean(corrected, axis=1)\n", - "_corrected_vmin = min(0.75*np.median(corrected_mean[corrected_mean > 0]), -0.5)\n", - "_corrected_vmax = max(2.*np.median(corrected_mean[corrected_mean > 0]), 100)\n", + "vmin, vmax = np.percentile(corrected_mean, [5, 95])\n", "\n", - "mean_plot_kwargs = dict(\n", - " vmin=_corrected_vmin, vmax=_corrected_vmax, cmap=\"jet\"\n", - ")\n", + "mean_plot_kwargs = dict(vmin=vmin, vmax=vmax, cmap=\"jet\")\n", "\n", "if strixel_sensor:\n", " if strixel_sensor == \"A1256\":\n", @@ -929,10 +927,11 @@ "display(Markdown((f\"#### A single image from train {tid}\")))\n", "\n", "fig, ax = plt.subplots(figsize=(18, 10))\n", + "vmin, vmax = np.percentile(corrected_train, [5, 95])\n", "\n", "single_plot_kwargs = dict(\n", - " vmin=min(0.75 * np.median(corrected_train[corrected_train > 0]), -0.5),\n", - " vmax=max(2.0 * np.median(corrected_train[corrected_train > 0]), 100),\n", + " vmin=vmin,\n", + " vmax=vmax,\n", " cmap=\"jet\"\n", ")\n", "\n", -- GitLab