diff --git a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02729_demo.ipynb b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02729_demo.ipynb index 9cffce196..9a2f7f816 100644 --- a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02729_demo.ipynb +++ b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02729_demo.ipynb @@ -68,10 +68,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Import Library\n", - "\n", "# --------------------------------------JWST Calibration Pipeline Imports-------------------------------------------\n", - "\n", "import jwst\n", "import crds\n", "from jwst import datamodels\n", @@ -80,35 +77,43 @@ "from jwst.pipeline import Spec3Pipeline # calwebb_spec3\n", "\n", "print(\"JWST Calibration Pipeline Version={}\".format(jwst.__version__))\n", - "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))\n", - "\n", - "# ----------------------------------------------General Imports-----------------------------------------------------\n", - "\n", - "import numpy as np # noqa\n", - "import warnings # noqa\n", - "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", - "\n", + "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "968d8315-5e14-498f-a3cd-134a6ab0fcd1", + "metadata": {}, + "outputs": [], + "source": [ "# --------------------------------------------File Operation Imports------------------------------------------------\n", "\n", - "import glob # noqa\n", - "import os # noqa\n", - "import json # noqa\n", - "from shutil import copy # noqa\n", + "import glob\n", + "import os\n", + "import json\n", + "from shutil import copy\n", "\n", "# --------------------------------------------Astropy/Astroquery Imports--------------------------------------------\n", "\n", - "from astropy.io import fits # noqa\n", - "from astropy import wcs # noqa\n", - "from astropy.wcs import WCS # noqa\n", - "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch # noqa\n", - "from astroquery.mast import Observations # noqa\n", + "from astropy.io import fits\n", + "from astropy import wcs\n", + "from astropy.wcs import WCS\n", + "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch\n", + "from astroquery.mast import Observations\n", "\n", "# ------------------------------------------------Plotting Imports--------------------------------------------------\n", "\n", - "import matplotlib.pyplot as plt # noqa\n", - "import matplotlib as mpl # noqa\n", - "import matplotlib.gridspec as grd # noqa\n", - "from matplotlib import cm # noqa\n", + "import matplotlib.pyplot as plt\n", + "import matplotlib as mpl\n", + "import matplotlib.gridspec as grd\n", + "from matplotlib import cm\n", + "\n", + "# ----------------------------------------------General Imports-----------------------------------------------------\n", + "\n", + "import numpy as np\n", + "import warnings\n", + "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", "\n", "# Use this version for non-interactive plots (easier scrolling of the notebook)\n", "%matplotlib inline\n", @@ -194,7 +199,7 @@ "\n", " # Zoom in on a portion of the image? \n", " if zoom_in:\n", - " # inset axis \n", + " # inset axis\n", " axins = ax.inset_axes([0.5, 0.6, 0.5, 0.3])\n", " \n", " axins.imshow(data_2d, origin=\"lower\", norm=norm, aspect=aspect, cmap=cmap)\n", diff --git a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo.ipynb b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo.ipynb index 4580caf46..25444f0cc 100644 --- a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo.ipynb +++ b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo.ipynb @@ -69,8 +69,6 @@ "metadata": {}, "outputs": [], "source": [ - "# Import Library\n", - "\n", "# --------------------------------------JWST Calibration Pipeline Imports-------------------------------------------\n", "\n", "import jwst\n", @@ -79,41 +77,48 @@ "from jwst.pipeline import Detector1Pipeline # calwebb_detector1\n", "from jwst.pipeline import Spec2Pipeline # calwebb_spec2\n", "from jwst.pipeline import Spec3Pipeline # calwebb_spec3\n", - "from jwst.extract_1d import Extract1dStep # Extract1D Individual Step\n", "\n", "print(\"JWST Calibration Pipeline Version={}\".format(jwst.__version__))\n", - "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))\n", - "\n", - "# ----------------------------------------------General Imports-----------------------------------------------------\n", - "\n", - "import numpy as np # noqa\n", - "import warnings # noqa\n", - "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", - "\n", + "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c5ef196-77d6-4fe5-bc06-efd86ea32be5", + "metadata": {}, + "outputs": [], + "source": [ "# --------------------------------------------File Operation Imports------------------------------------------------\n", "\n", - "import glob # noqa\n", - "import os # noqa\n", - "import asdf # noqa\n", - "import json # noqa\n", - "from shutil import copy # noqa\n", + "import glob\n", + "import os\n", + "import asdf\n", + "import json\n", + "from shutil import copy\n", "\n", "# --------------------------------------------Astropy/Astroquery Imports--------------------------------------------\n", "\n", - "from astropy.io import fits # noqa\n", - "from astropy import wcs # noqa\n", - "from astropy.wcs import WCS # noqa\n", - "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch, SqrtStretch\n", - "import astroquery # noqa\n", - "from astroquery.mast import Mast # noqa\n", - "from astroquery.mast import Observations # noqa\n", + "from astropy.io import fits\n", + "from astropy import wcs\n", + "from astropy.wcs import WCS\n", + "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch\n", + "import astroquery\n", + "from astroquery.mast import Mast\n", + "from astroquery.mast import Observations\n", "\n", "# ------------------------------------------------Plotting Imports--------------------------------------------------\n", "\n", - "import matplotlib.pyplot as plt # noqa\n", - "import matplotlib as mpl # noqa\n", + "import matplotlib.pyplot as plt\n", + "import matplotlib as mpl\n", "import matplotlib.gridspec as grd\n", - "from matplotlib import cm # noqa\n", + "from matplotlib import cm\n", + "\n", + "# ----------------------------------------------General Imports-----------------------------------------------------\n", + "\n", + "import numpy as np\n", + "import warnings\n", + "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", "\n", "# Use this version for non-interactive plots (easier scrolling of the notebook)\n", "%matplotlib inline\n", @@ -214,7 +219,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "3d233556", "metadata": {}, "outputs": [], @@ -265,7 +270,7 @@ " \n", " for s3d_file in s3d_file_list:\n", " \n", - " root=s3d_file[:-9] # Root file name \n", + " root = s3d_file[:-9] # Root file name \n", "\n", " s3d = fits.open(s3d_file) # 3-D IFU data cube fits file\n", " x1d3 = datamodels.open(root+'_x1d.fits') # 1-D Extracted Spectrum \n", @@ -353,7 +358,7 @@ " ax1.set_xlabel('RA', fontsize=22)\n", " ax1.set_ylabel('DEC', labelpad=-1, fontsize=22)\n", " # ax1.grid(color='white', ls='solid')\n", - " ax1.set_title('Detector {} \\n Grating/Filter: {}/{} \\n {} microns'.format(s3d[0].header['DETECTOR'],s3d[0].header['GRATING'], s3d[0].header['FILTER'], str(slicewave)), fontsize=25)\n", + " ax1.set_title('Detector {} \\n Grating/Filter: {}/{} \\n {} microns'.format(s3d[0].header['DETECTOR'], s3d[0].header['GRATING'], s3d[0].header['FILTER'], str(slicewave)), fontsize=25)\n", " ax1.tick_params(axis='both', which='major', labelsize=20)\n", " ax1.coords[0].set_ticklabel(rotation=13, ha='right', pad=24)\n", "\n", @@ -365,13 +370,13 @@ " # ax2 = plt.subplot(3,len(wavelength_slices), int(total_num_plots/3)+plot_count)\n", " ax2 = plt.subplot(gs[int(total_num_plots/3)+plot_count])\n", "\n", - " # Spaxel Box Highlight \n", + " # Spaxel Box Highlight\n", " spaxel_rect = plt.Rectangle((loc[0]-.5, loc[1]-.5), 1, 1, fill=False, color='black', linewidth=2)\n", " ax1.add_patch(spaxel_rect)\n", " \n", " ax2.plot(x1d3wave, x1d3flux_loc, linewidth=1, color=colors[i])\n", " ax2.grid(linewidth=2)\n", - " ax2.set_xlabel(r'$\\u03BB [\\u03BC$m]',fontsize=22)\n", + " ax2.set_xlabel(r'$\\u03BB [\\u03BC$m]', fontsize=22)\n", " ax2.set_ylabel(\"Surface Brightness \\n (MJy/sr)\", fontsize=22)\n", " ax2.set_title('Spaxel at (x, y)='+repr(loc), fontsize=25)\n", " ax2.tick_params(axis='both', which='major', labelsize=20)\n", @@ -437,22 +442,10 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "f94025d4", "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'os' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[2], line 13\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m runflag:\n\u001b[1;32m 10\u001b[0m \u001b[38;5;66;03m# If you want to actually re-download the data and run everything offline, \u001b[39;00m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# then comment out this line, set runflag=True, & specify a desired local directory\u001b[39;00m\n\u001b[1;32m 12\u001b[0m output_dir \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m./nirspec_ifu_02732_rerun/\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m---> 13\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[43mos\u001b[49m\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mexists(output_dir):\n\u001b[1;32m 14\u001b[0m os\u001b[38;5;241m.\u001b[39mmakedirs(output_dir)\n", - "\u001b[0;31mNameError\u001b[0m: name 'os' is not defined" - ] - } - ], + "outputs": [], "source": [ "# To rerun the notebook and all the pipeline steps set runflag=True\n", "runflag = True \n", @@ -610,8 +603,7 @@ " title='Data Quality Map \\n Detector: {} \\n 8-Cycle Dither Position Index: {} \\n GRATING/FILTER: {}/{}'.format(ratefile_open.meta.instrument.detector,\n", " ratefile_open.meta.dither.position_number, \n", " ratefile_open.meta.instrument.grating,\n", - " ratefile_open.meta.instrument.filter)) \n", - " " + " ratefile_open.meta.instrument.filter))" ] }, { @@ -838,7 +830,6 @@ " ratefile_sci = ratefile_open.data # Get the pixel data (the SCI extension of the fits file)\n", " ratefile_dq = ratefile_open.dq # The Data Quality Map Data\n", " \n", - " \n", " show_image(ratefile_sci, 0, 10, units='DN/s', zoom_in=[500, 550, 1250, 1300],\n", " title='Countrate Image \\n Detector: {} \\n 8-Cycle Dither Position Index: {} \\n GRATING/FILTER: {}/{}'.format(ratefile_open.meta.instrument.detector,\n", " ratefile_open.meta.dither.position_number, \n", @@ -920,8 +911,8 @@ "\n", "\n", "# Characteristics of the plot \n", - "nrs1_wavelengths = [1.4, 3.3, 4.5] # Wavelength slices (microns) to take from the 3-D data cube\n", - "nrs1_spaxel_locs = [[30, 29], [28, 39], [14, 25]] #Spaxel locations for associated 1-D spectrum (one spaxel plotted per slice)\n", + "nrs1_wavelengths = [1.4, 3.3, 4.5] # Wavelength slices (microns) to take from the 3-D data cube\n", + "nrs1_spaxel_locs = [[30, 29], [28, 39], [14, 25]] # Spaxel locations for associated 1-D spectrum (one spaxel plotted per slice)\n", "\n", "\n", "# Plot using the convience function defined above\n", diff --git a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo_pointsource.ipynb b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo_pointsource.ipynb index d6c473a5e..510901bc3 100644 --- a/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo_pointsource.ipynb +++ b/notebooks/NIRSpec_IFU_spectral_extraction/ero_nirspec_ifu_02732_demo_pointsource.ipynb @@ -64,8 +64,6 @@ "metadata": {}, "outputs": [], "source": [ - "# Import Library\n", - "\n", "# --------------------------------------JWST Calibration Pipeline Imports-------------------------------------------\n", "\n", "import jwst\n", @@ -77,39 +75,46 @@ "from jwst.extract_1d import Extract1dStep # Extract1D Individual Step\n", "\n", "print(\"JWST Calibration Pipeline Version={}\".format(jwst.__version__))\n", - "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))\n", - "\n", - "# ----------------------------------------------General Imports-----------------------------------------------------\n", - "\n", - "import numpy as np # noqa\n", - "import warnings # noqa\n", - "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", - "\n", + "print(\"Current Operational CRDS Context = {}\".format(crds.get_default_context()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ecbdca5b-af15-424c-a1d4-525094dfe17f", + "metadata": {}, + "outputs": [], + "source": [ "# --------------------------------------------File Operation Imports------------------------------------------------\n", - "\n", - "import glob # noqa\n", - "import os # noqa\n", - "import asdf # noqa\n", - "import json # noqa\n", - "from shutil import copy # noqa\n", + "import glob\n", + "import os\n", + "import asdf\n", + "import json\n", + "from shutil import copy\n", "\n", "# --------------------------------------------Astropy/Astroquery Imports--------------------------------------------\n", "\n", - "from astropy.io import fits # noqa\n", - "from astropy import wcs # noqa\n", - "from astropy.wcs import WCS # noqa\n", - "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch # noqa\n", - "import astroquery # noqa\n", - "from astroquery.mast import Mast # noqa\n", - "from astroquery.mast import Observations # noqa\n", + "from astropy.io import fits\n", + "from astropy import wcs\n", + "from astropy.wcs import WCS\n", + "from astropy.visualization import ImageNormalize, ManualInterval, LogStretch, LinearStretch, AsinhStretch\n", + "import astroquery\n", + "from astroquery.mast import Mast\n", + "from astroquery.mast import Observations\n", "\n", "# ------------------------------------------------Plotting Imports--------------------------------------------------\n", "\n", - "import matplotlib.pyplot as plt # noqa\n", - "import matplotlib as mpl # noqa\n", - "import matplotlib.gridspec as grd # noqa\n", - "from matplotlib.patches import Circle # noqa\n", - "from matplotlib import cm # noqa\n", + "import matplotlib.pyplot as plt\n", + "import matplotlib as mpl\n", + "import matplotlib.gridspec as grd\n", + "from matplotlib.patches import Circle\n", + "from matplotlib import cm\n", + "\n", + "# ----------------------------------------------General Imports-----------------------------------------------------\n", + "\n", + "import numpy as np\n", + "import warnings\n", + "warnings.filterwarnings('ignore') # Set to 'default' to turn warnings back on\n", "\n", "# Use this version for non-interactive plots (easier scrolling of the notebook)\n", "%matplotlib inline\n", @@ -205,7 +210,7 @@ " axins.set_ylim(zoom_in[2], zoom_in[3])\n", " axins.set_xticklabels([])\n", " axins.set_yticklabels([])\n", - " ax.indicate_inset_zoom(axins, color=\"black\",edgecolor=\"black\", linewidth=3)" + " ax.indicate_inset_zoom(axins, color=\"black\", edgecolor=\"black\", linewidth=3)" ] }, { @@ -261,7 +266,7 @@ " \n", " for s3d_file in s3d_file_list:\n", " \n", - " root=s3d_file[:-9] # Root file name \n", + " root = s3d_file[:-9] # Root file name \n", "\n", " s3d = fits.open(s3d_file) # 3-D IFU data cube fits file \n", " x1d3 = datamodels.open(root+'_x1d.fits') # 1-D Extracted Spectrum \n", @@ -365,7 +370,7 @@ " \n", " ax2.plot(x1d3wave, x1d3flux_loc, linewidth=1, color=colors[i])\n", " ax2.grid(linewidth=2)\n", - " ax2.set_xlabel('$\\u03BB [\\u03BC$m]',fontsize=22)\n", + " ax2.set_xlabel('$\\u03BB [\\u03BC$m]', fontsize=22)\n", " ax2.set_ylabel(\"Surface Brightness \\n (MJy/sr)\", fontsize=22)\n", " ax2.set_title('Spaxel at (x, y)='+repr(loc), fontsize=25)\n", " ax2.tick_params(axis='both', which='major', labelsize=20)\n", @@ -585,13 +590,12 @@ " ratefile_sci = ratefile_open.data # Get the pixel data (the SCI extension of the fits file)\n", " ratefile_dq = ratefile_open.dq # The Data Quality Map Data\n", " \n", - " \n", - " show_image(ratefile_sci, 0,10, units='DN/s',zoom_in=[500, 550, 1250, 1300],\n", + " show_image(ratefile_sci, 0, 10, units='DN/s', zoom_in=[500, 550, 1250, 1300],\n", " title='Countrate Image \\n Detector: {} \\n 8-Cycle Dither Position Index: {} \\n GRATING/FILTER: {}/{}'.format(ratefile_open.meta.instrument.detector,\n", " ratefile_open.meta.dither.position_number, \n", " ratefile_open.meta.instrument.grating,\n", " ratefile_open.meta.instrument.filter)) # rate files have units of DN/s\n", - " show_image(ratefile_dq, 0, 10, units='Bit Value', scale='linear',zoom_in=[500, 550, 1250, 1300],\n", + " show_image(ratefile_dq, 0, 10, units='Bit Value', scale='linear', zoom_in=[500, 550, 1250, 1300],\n", " title='Data Quality Map \\n Detector: {} \\n 8-Cycle Dither Position Index: {} \\n GRATING/FILTER: {}/{}'.format(ratefile_open.meta.instrument.detector,\n", " ratefile_open.meta.dither.position_number, \n", " ratefile_open.meta.instrument.grating,\n", @@ -680,14 +684,13 @@ "# Plotting the 4th (out of 8) dither position\n", "stage2_s3d_file = sorted(glob.glob(output_dir+'*00004_nrs1_s3d.fits')) \n", "\n", - "title_stage2_rerun='NGC 7319 AGN \\n Level 2 IFU Product: 3-D Cube Slices vs. Corresponding 3-D Weighted Map'\n", + "title_stage2_rerun = 'NGC 7319 AGN \\n Level 2 IFU Product: 3-D Cube Slices vs. Corresponding 3-D Weighted Map'\n", "\n", "\n", "# Characteristics of the plot \n", "nrs1_wavelengths = [1.4, 3.3, 4.5] # Wavelength slices (microns) to take from the 3-D data cube\n", "nrs1_spaxel_locs = [[30, 29], [28, 39], [14, 25]] # Spaxel locations for associated 1-D spectrum (one spaxel plotted per slice)\n", "\n", - "\n", "# Plot using the convience function defined above\n", "show_ifu_cubeslices(stage2_s3d_file, wavelength_slices=[nrs1_wavelengths], spaxel_locs=[nrs1_spaxel_locs], title=title_stage2_rerun)" ] @@ -765,15 +768,13 @@ "source": [ "# Rerun stage 3 with outlier detection on\n", "if runflag:\n", - "\n", " result = Spec3Pipeline.call(asnfile_rerun_point,\n", " save_results=True,\n", " output_dir=output_dir,\n", " steps={\"outlier_detection\": {\"skip\": False,\n", " \"save_results\": True,\n", " \"kernel_size\": '3 3'},\n", - " \"extract_1d\": {\"subtract_background\": False}}) # Do not automatically apply background subtraction until we modify the extraction region\n", - " " + " \"extract_1d\": {\"subtract_background\": False}}) # Do not automatically apply background subtraction until we modify the extraction region" ] }, { @@ -787,7 +788,7 @@ "\n", "stage3_s3d_file_point = sorted(glob.glob(output_dir+'*nirspec_prism-clear_s3d.fits')) \n", "\n", - "title_stage3_rerun_point='NGC 7319 AGN \\n Level 3 IFU Product: 3-D Cube Slices vs. Corresponding 3-D Weighted Map'\n", + "title_stage3_rerun_point = 'NGC 7319 AGN \\n Level 3 IFU Product: 3-D Cube Slices vs. Corresponding 3-D Weighted Map'\n", "\n", "# Characteristics of the plot \n", "nrs1_wavelengths = [1.4, 3.3, 4.5] # Wavelength slices (microns) to take from the 3-D data cube\n", @@ -867,23 +868,23 @@ "# Extraction Region Preview\n", "# Open Combined 3-D Cube FITS file\n", "s3d = fits.open(glob.glob(output_dir+'*nirspec_prism-clear_s3d.fits')[0])\n", - "cube = s3d[1].data #Science data\n", + "cube = s3d[1].data # Science data\n", "\n", "# Plot the full IFU cube\n", - "ax = plt.subplot(1, 1, 1)#, projection=wcs, slices=('x', 'y', nslice3)) # Set up the subplot space\n", + "ax = plt.subplot(1, 1, 1) #, projection=wcs, slices=('x', 'y', nslice3)) # Set up the subplot space\n", "slice_mean = np.nanmean(cube[400:500, :, :], axis=0) # Mean of the slice looking in the range (nslice2-2):(nslice2+2)\n", "slice_norm = ImageNormalize(slice_mean, vmin=0, vmax=150, stretch=AsinhStretch()) # Normalize &stretch\n", "slice_full = ax.imshow(slice_mean, norm=slice_norm, origin='lower', cmap='jet') # Plot slice\n", "\n", "# Colorbar\n", "cb_image = plt.colorbar(slice_full, fraction=0.046, pad=0.04)\n", - "cb_image.set_label('MJy/sr', labelpad=-1, fontsize = 10)\n", + "cb_image.set_label('MJy/sr', labelpad=-1, fontsize=10)\n", "cb_image.ax.tick_params(labelsize=10)\n", "cb_image.ax.yaxis.get_offset_text().set_fontsize(10)\n", "\n", "radius = Circle((29, 29), 9, fill=False, label='Radius')\n", - "inner_bkg = Circle((29, 29), 10, color='b',fill=False, label='Inner Background Radius')\n", - "outer_bkg= Circle((29, 29), 15, color='r',fill=False, label='Outer Background Radius')\n", + "inner_bkg = Circle((29, 29), 10, color='b', fill=False, label='Inner Background Radius')\n", + "outer_bkg = Circle((29, 29), 15, color='r', fill=False, label='Outer Background Radius')\n", "ax.add_patch(radius)\n", "ax.add_patch(inner_bkg)\n", "ax.add_patch(outer_bkg)\n", @@ -959,8 +960,8 @@ "plt.vlines(3.3, 0., 400., 'red', 'dotted', label='3.3 microns')\n", "plt.vlines(4.5, 0., 400., 'green', 'dotted', label='4.5 microns')\n", "\n", - "plt.xlabel('$\\lambda [\\mu$m]')\n", - "plt.ylabel('Flux (Jy)', fontsize =20)\n", + "plt.xlabel(r'$\\lambda [\\mu$m]')\n", + "plt.ylabel('Flux (Jy)', fontsize=20)\n", "plt.title(\"NGC 7319 AGN \\n Level 3 IFU Product: Extracted 1-D Spectrum with Background Subtraction\")\n", "plt.ylim(0, 10**-1.6)\n", "plt.ticklabel_format(axis='y', style='sci', scilimits=(0, -2))\n",