From ce7fcdbc06b5480d68c55c365960cfb1382faa82 Mon Sep 17 00:00:00 2001 From: James Ball Date: Wed, 6 Mar 2024 10:46:57 +0100 Subject: [PATCH] Forgot to also add to batch cells --- ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map.ipynb | 10 ++++++++++ .../S3DXRD/2_S3DXRD_sinograms_map_minor_phase.ipynb | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map.ipynb b/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map.ipynb index 764d5e1b..40612c28 100644 --- a/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map.ipynb +++ b/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map.ipynb @@ -1293,6 +1293,16 @@ " if \"slice_recon\" in hin.keys():\n", " print(f\"Already reconstructed {dataset} in {sample}, skipping\")\n", " continue\n", + " \n", + " if not hasattr(ds, \"ring_currents\"):\n", + " ring_currents = []\n", + " with h5py.File(ds.masterfile, \"r\") as h5in:\n", + " for scan in ds.scans:\n", + " ring_current = float(h5in[scan][\"instrument/machine/current\"][()])\n", + " ring_currents.append(ring_current)\n", + "\n", + " ds.ring_currents = np.array(ring_currents)\n", + " ds.ring_currents_scaled = np.array(ring_currents/np.max(ring_currents))\n", " \n", " cf_4d = ImageD11.columnfile.columnfile(ds.col4dfile)\n", " cf_4d.parameters.loadparameters(par_path)\n", diff --git a/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map_minor_phase.ipynb b/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map_minor_phase.ipynb index fd011e94..edfc3c9c 100755 --- a/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map_minor_phase.ipynb +++ b/ImageD11/nbGui/S3DXRD/2_S3DXRD_sinograms_map_minor_phase.ipynb @@ -1195,6 +1195,17 @@ " if \"slice_recon\" in hin.keys():\n", " print(f\"Already reconstructed {dataset} in {sample}, skipping\")\n", " continue\n", + " \n", + " \n", + " if not hasattr(ds, \"ring_currents\"):\n", + " ring_currents = []\n", + " with h5py.File(ds.masterfile, \"r\") as h5in:\n", + " for scan in ds.scans:\n", + " ring_current = float(h5in[scan][\"instrument/machine/current\"][()])\n", + " ring_currents.append(ring_current)\n", + "\n", + " ds.ring_currents = np.array(ring_currents)\n", + " ds.ring_currents_scaled = np.array(ring_currents/np.max(ring_currents))\n", " \n", " cf_4d = ImageD11.columnfile.columnfile(ds.col4dfile)\n", " cf_4d.parameters.loadparameters(par_path)\n",