diff --git a/notebooks/COS/ExceptionReport/ExceptionReport.ipynb b/notebooks/COS/ExceptionReport/ExceptionReport.ipynb index 772a1772d..6a8524f36 100644 --- a/notebooks/COS/ExceptionReport/ExceptionReport.ipynb +++ b/notebooks/COS/ExceptionReport/ExceptionReport.ipynb @@ -89,7 +89,6 @@ "\n", "import shutil\n", "import os\n", - "import glob\n", "from pathlib import Path\n", "\n", "import cos_functions as cf\n", @@ -244,52 +243,6 @@ "print_exposure_summary(successful_raw_a)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# query = Observations.query_criteria(\n", - "# obs_id=\"LDI707030\",\n", - "# filters=\"G130M\"\n", - "# )\n", - "\n", - "# prods = Observations.get_product_list(\n", - "# query,\n", - "# )\n", - "\n", - "# prods = Observations.filter_products(\n", - "# prods,\n", - "# productSubGroupDescription=[\"RAWTAG_A\", \"RAWTAG_B\", \"X1D\"]\n", - "# )\n", - "\n", - "# Observations.download_products(prods[:3],\n", - "# download_dir=\".\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# path = \"/Users/sigomez/Documents/exception-report/ExceptionReport/files.fits\"\n", - "\n", - "# from astropy.table import Table\n", - "\n", - "# table = Table.read(path)\n", - "\n", - "# table.remove_rows([0, 1, 2])\n", - "\n", - "# for row in prods[:3]:\n", - "# table.add_row(row)\n", - "\n", - "# table.write(\"files.fits\", \n", - "# format='fits', \n", - "# overwrite=True)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -505,13 +458,13 @@ " Output:\n", " SNR is plotted.\n", " '''\n", - " fig = plt.Figure(figsize=(12, 10))\n", + " plt.Figure(figsize=(12, 10))\n", "\n", " for file in sorted(filelist):\n", " with fits.open(file) as hdul:\n", " if \"x1dsum\" in file:\n", " exptime = hdul[1].header[\"EXPTIME\"]\n", - " label=f\"X1DSUM - {exptime} sec\"\n", + " label = f\"X1DSUM - {exptime} sec\"\n", "\n", " else:\n", " fppos = hdul[0].header[\"FPPOS\"]\n", @@ -530,8 +483,8 @@ " weighted=True,\n", " )\n", "\n", - " plt.plot(np.concatenate([snr_est[1][1][0],snr_est[1][0][0]], axis=0), \n", - " np.concatenate([snr_est[1][1][1],snr_est[1][0][1]], axis=0),\n", + " plt.plot(np.concatenate([snr_est[1][1][0], snr_est[1][0][0]], axis=0), \n", + " np.concatenate([snr_est[1][1][1], snr_est[1][0][1]], axis=0),\n", " label=label,\n", " lw=1,\n", " alpha=0.6)\n", @@ -794,9 +747,9 @@ " )\n", "\n", " conf_im = confirm.imshow(hdul[4].data,\n", - " vmin=0, \n", - " vmax=0.1, \n", - " aspect=\"auto\")\n", + " vmin=0, \n", + " vmax=0.1, \n", + " aspect=\"auto\")\n", "\n", " confirm.plot(\n", " header[\"ACQCENTX\"],\n", @@ -921,10 +874,11 @@ " )\n", "\n", " for subplot, column in zip(ax, [\"XDISP_OFFSET\", \"DISP_OFFSET\"]):\n", + "\n", " subplot.set_xlabel(column,\n", - " fontweight=\"bold\")\n", + " fontweight=\"bold\")\n", " subplot.set_ylabel(\"DWELL POINT\",\n", - " fontweight=\"bold\")\n", + " fontweight=\"bold\")\n", "\n", " subplot.axvline(0, 0, 6,\n", " linestyle=\"dashed\",\n", @@ -940,7 +894,7 @@ " \n", " cbd = fig.colorbar(cd, ax=ax[1])\n", " cbd.set_label(\"Counts\",\n", - " fontweight=\"bold\")\n", + " fontweight=\"bold\")\n", "\n", " ax[0].set_title(f'PEAKXD for {fits.getval(peakxd, \"ROOTNAME\")}',\n", " fontweight=\"bold\")\n", @@ -1308,9 +1262,9 @@ " if rss:\n", " return v2_stdev, v3_stdev\n", "\n", - " fig = plt.Figure(figsize=(12, 12))\n", + " plt.Figure(figsize=(12, 12))\n", "\n", - " hist = plt.hist2d(\n", + " plt.hist2d(\n", " x=v2_avg, \n", " y=v3_avg,\n", " bins=n_bins\n", @@ -1333,7 +1287,7 @@ " label_y = ellipse_center[1] + n_sigma * v3_stdev / 2\n", "\n", " ax.text(label_x, label_y,\n", - " f'{n_sigma}$\\sigma$ contour',\n", + " f'{n_sigma} sigma contour',\n", " color='black',\n", " bbox=dict(facecolor=\"white\",\n", " alpha=0.7),\n",