diff --git a/notebooks/Jungfrau/Jungfrau_gain_Spectra_Fit_Summary_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_gain_Spectra_Fit_Summary_NBC.ipynb index 178fbd031fcf6e8bc084f6271691b27bfaf47005..dc40e72af907ec4ddd3cdfd2236c4775cda9a707 100644 --- a/notebooks/Jungfrau/Jungfrau_gain_Spectra_Fit_Summary_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_gain_Spectra_Fit_Summary_NBC.ipynb @@ -95,11 +95,9 @@ " Path(out_folder) / spectra_fit_temp.format(run, proposal.upper(), da, fit_func),\n", " 'r'\n", " ) as f:\n", + " # f[g0_fit_dataset] shape is 1024, 512, mem_cells\n", " stacked_constants[i] = np.moveaxis(\n", - " np.mean(\n", - " np.transpose(np.array(f[g0_fit_dataset])),\n", - " axis=-1\n", - " ), 0, 1)\n", + " np.mean(np.array(f[g0_fit_dataset]), axis=-1), 0, 1)\n", " \n", "fig, ax = plt.subplots(figsize=(18, 10))\n", "vmin, vmax = np.percentile(stacked_constants, [5, 95])\n", @@ -111,41 +109,7 @@ " cmap=\"jet\",\n", " colorbar={'shrink': 1, 'pad': 0.01},\n", ")\n", - "ax.set_title(f'{karabo_id} - Histo', size=18)\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "proposal = list(filter(None, in_folder.strip('/').split('/')))[-2]\n", - "run = runs[0] # TODO this will need to be fixed when I start implementing multiple runs.\n", - "stacked_constants = np.full(geom.expected_data_shape, np.nan) # nmods, 512, 1024\n", - "\n", - "for i, da in enumerate (da_to_pdu.keys()):\n", - " with h5file(\n", - " Path(out_folder) / spectra_fit_temp.format(run, proposal.upper(), da, fit_func),\n", - " 'r'\n", - " ) as f:\n", - " stacked_constants[i] = np.moveaxis(\n", - " np.mean(\n", - " np.array(f[g0_fit_dataset]),\n", - " axis=-1\n", - " ), 0, 1)\n", - "vmin, vmax = np.percentile(stacked_constants, [5, 95])\n", - "fig, ax = plt.subplots(figsize=(18, 10))\n", - "geom.plot_data_fast(\n", - " stacked_constants,\n", - " ax=ax,\n", - " vmin=vmin,\n", - " vmax=vmax,\n", - " cmap=\"jet\",\n", - " colorbar={'shrink': 1, 'pad': 0.01},\n", - ")\n", - "ax.set_title(f'{karabo_id} - Fitting', size=18)\n", + "ax.set_title(f'{karabo_id} - Spectra Fit', size=18)\n", "plt.show()" ] }