Skip to content

Commit

Permalink
Update second plotting cell
Browse files Browse the repository at this point in the history
  • Loading branch information
srosagomez committed Sep 11, 2024
1 parent fed718f commit 0af645e
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions notebooks/COS/ExceptionReport/ExceptionReport.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,21 @@
" flux = data[\"FLUX\"].ravel()\n",
" wl = data[\"WAVELENGTH\"].ravel()\n",
"\n",
"# Plotting flux vs wavelength on top row\n",
"ax[0][0].plot(wl, flux,\n",
"for i, axis in enumerate(ax[0]):\n",
" # Plotting flux vs wavelength on top row\n",
" axis.plot(wl, flux,\n",
" lw=2,\n",
" color=\"black\")\n",
"\n",
"ax[0][1].plot(wl, flux,\n",
" lw=2,\n",
" color=\"black\")\n",
" axis.set_xlabel(r'Wavelength [$\\AA$]')\n",
" axis.set_ylabel(r'Flux [$erg\\ s^{-1}\\ cm^{-2}\\ \\AA^{-1}$]')\n",
"\n",
" if i == 0:\n",
" axis.set_title(\"Flux vs Wavelength\")\n",
"\n",
" else:\n",
" axis.set_title(\"Flux vs Wavelength, ZOOMED\")\n",
" axis.set_ylim(0, 1.5e-14)\n",
"\n",
"# Plotting the counts on the detector for bottom row\n",
"with fits.open(failed_raw_a) as hdul:\n",
Expand All @@ -370,33 +377,26 @@
" color=\"red\"\n",
" )\n",
"\n",
"with fits.open(failed_raw_b) as hdul:\n",
" data = hdul[1].data\n",
" ax[1][1].scatter(\n",
" data[\"RAWX\"],\n",
" data[\"RAWY\"],\n",
" s=1,\n",
" color=\"blue\"\n",
" )\n",
"\n",
"# Adding formatting and titles to flux vs wl row\n",
"ax[0][0].set_title(\"Flux vs Wavelength\")\n",
"ax[0][0].set_xlabel(r'Wavelength [$\\AA$]')\n",
"ax[0][0].set_ylabel(r'Flux [$erg\\ s^{-1}\\ cm^{-2}\\ \\AA^{-1}$]')\n",
"\n",
"ax[0][1].set_title(\"Flux vs Wavelength, ZOOMED\")\n",
"ax[0][1].set_xlabel(r'Wavelength [$\\AA$]')\n",
"ax[0][1].set_ylabel(r'Flux [$erg\\ s^{-1}\\ cm^{-2}\\ \\AA^{-1}$]')\n",
"\n",
"ax[0][1].set_ylim(0, 1.5e-14)\n",
"for i, axis in enumerate(ax[1]):\n",
" # Plotting the counts on the detector for bottom row\n",
" with fits.open([failed_raw_a, failed_raw_b][i]) as hdul:\n",
" data = hdul[1].data\n",
" axis.scatter(\n",
" data[\"RAWX\"],\n",
" data[\"RAWY\"],\n",
" s=1,\n",
" color=[\"red\", \"blue\"][i],\n",
" alpha=0.05\n",
" )\n",
"\n",
"ax[1][0].set_title(\"RAWY vs RAWX, FUVA\")\n",
"ax[1][0].set_xlabel(\"RAWX\")\n",
"ax[1][0].set_ylabel(\"RAWY\")\n",
" axis.set_xlabel(\"RAWX\")\n",
" axis.set_ylabel(\"RAWY\")\n",
" \n",
" if i == 0:\n",
" axis.set_title(\"RAWY vs RAWX, FUVA\")\n",
"\n",
"ax[1][1].set_title(\"RAWY vs RAWX, FUVB\")\n",
"ax[1][1].set_xlabel(\"RAWX\")\n",
"ax[1][1].set_ylabel(\"RAWY\")\n",
" else:\n",
" axis.set_title(\"RAWY vs RAWX, FUVB\")\n",
"\n",
"plt.suptitle(f'Failed Exposure, {fits.getval(failed_x1d, \"ROOTNAME\")}',\n",
" fontweight=\"bold\",\n",
Expand Down

0 comments on commit 0af645e

Please sign in to comment.