Skip to content
Snippets Groups Projects

[Jungfrau][Correct] Avoid `NAN` disturbance for correction plots scale

Merged Karim Ahmed requested to merge fix/avoid_nan_scale_disturbance into master
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
@@ -775,6 +775,7 @@
"metadata": {},
"outputs": [],
"source": [
"step_timer.start()\n",
"first_seq = 0 if sequences == [-1] else sequences[0]\n",
"\n",
"corrected_files = [\n",
@@ -817,7 +818,8 @@
"gain = jf_raw.get_array(\"data.gain\")[:, :, cell_idx_preview, ...].values\n",
"gain_train_cells = (\n",
" jf_raw.select_trains(by_id[[tid]]).get_array(\"data.gain\")[:, :, :, ...].values\n",
")"
")\n",
"step_timer.done_step(\"Prepared data for plotting\")"
]
},
{
@@ -865,8 +867,8 @@
"print(f\"The per pixel mean of the first {corrected.shape[1]} trains of the first sequence file\")\n",
"\n",
"fig, ax = plt.subplots(figsize=(18, 10))\n",
"corrected_mean = np.mean(corrected, axis=1)\n",
"vmin, vmax = np.percentile(corrected_mean, [5, 95])\n",
"corrected_mean = np.nanmean(corrected, axis=1)\n",
"vmin, vmax = np.nanpercentile(corrected_mean, [5, 95])\n",
"\n",
"mean_plot_kwargs = dict(vmin=vmin, vmax=vmax)\n",
"\n",
@@ -929,7 +931,7 @@
"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",
"vmin, vmax = np.nanpercentile(corrected_train, [5, 95])\n",
"\n",
"single_plot_kwargs = dict(\n",
" vmin=vmin,\n",
Loading