diff --git a/_toc.yml b/_toc.yml index 69f53db56..63f4838fd 100644 --- a/_toc.yml +++ b/_toc.yml @@ -63,6 +63,7 @@ parts: - file: notebooks/STIS/view_data/view_data.ipynb - file: notebooks/STIS/extraction/1D_Extraction.ipynb - file: notebooks/STIS/low_count_uncertainties/Low_Count_Uncertainties.ipynb + - file: notebooks/STIS/contrast_sensitivity/STIS_Coronagraphic_Observation_Feasibility.ipynb - caption: WFC3 chapters: - file: notebooks/WFC3/README.md diff --git a/notebooks/STIS/README.md b/notebooks/STIS/README.md index 9003ce861..a868d7496 100644 --- a/notebooks/STIS/README.md +++ b/notebooks/STIS/README.md @@ -7,6 +7,8 @@ The current operational notebooks with a short description: ### STIS Coronagraphic Visualization Tool (CoronagraphyViz) Jupyter Notebook that assists users in planning and preparing STIS coronagraphic observations. +### STIS Coronagraphic Observation Feasibility (constrast_sensitivity) +A complimentary notebook to the Coronagraphic Visualization Tool, that acts as a guide to assess the feasibility of high-contrast imaging observations of point sources (i.e. exoplanets, brown dwarf companions) and/or disks around stars for a given expected contrast at the 1, 3 and 5 $\sigma$ level with STIS coronagraphy. ### STIS DrizzlePac Tutorial (drizpac_notebook) Jupyter Notebook for aligning and combining STIS images with [DrizzlePac](https://www.stsci.edu/scientific-community/software/drizzlepac.html). ### Viewing STIS Data (view_data) diff --git a/notebooks/STIS/contrast_sensitivity/GO12923raw.dat b/notebooks/STIS/contrast_sensitivity/GO12923raw.dat new file mode 100644 index 000000000..ab84f8062 --- /dev/null +++ b/notebooks/STIS/contrast_sensitivity/GO12923raw.dat @@ -0,0 +1,89 @@ +#r(") Med.Contr/px err_Med.Contr/px +0.225 1.03801e-03 2.38558e-05 +0.275 5.99395e-04 1.16666e-04 +0.325 4.80774e-04 9.13354e-05 +0.375 3.41878e-04 7.79185e-05 +0.425 2.50762e-04 3.95687e-05 +0.475 2.02378e-04 1.83912e-05 +0.525 1.52907e-04 1.53782e-05 +0.575 1.18198e-04 1.47812e-05 +0.625 1.00455e-04 1.29091e-05 +0.675 8.47489e-05 1.00150e-05 +0.725 7.07549e-05 7.52194e-06 +0.775 5.84796e-05 6.26959e-06 +0.825 4.77119e-05 6.54608e-06 +0.875 4.22602e-05 6.76270e-06 +0.925 3.64204e-05 5.57618e-06 +0.975 3.22307e-05 4.76458e-06 +1.025 2.94713e-05 3.44906e-06 +1.075 2.66426e-05 3.74232e-06 +1.125 2.50548e-05 3.46150e-06 +1.175 2.29071e-05 2.79111e-06 +1.225 2.11947e-05 2.82655e-06 +1.275 2.05736e-05 2.92009e-06 +1.325 1.92578e-05 2.80669e-06 +1.375 1.77092e-05 2.80179e-06 +1.425 1.71141e-05 2.94597e-06 +1.475 1.54688e-05 2.86470e-06 +1.525 1.43795e-05 2.59273e-06 +1.575 1.34089e-05 2.38882e-06 +1.625 1.22792e-05 2.11045e-06 +1.675 1.12224e-05 1.99796e-06 +1.725 1.07173e-05 1.83143e-06 +1.775 1.00761e-05 1.73875e-06 +1.825 9.18950e-06 1.69094e-06 +1.875 8.28843e-06 1.54942e-06 +1.925 7.95552e-06 1.47887e-06 +1.975 7.35777e-06 1.45991e-06 +2.025 6.83176e-06 1.16803e-06 +2.075 6.35545e-06 1.16560e-06 +2.125 5.97843e-06 1.07451e-06 +2.175 5.21944e-06 9.50909e-07 +2.225 4.88599e-06 8.43229e-07 +2.275 4.47248e-06 8.56552e-07 +2.325 4.26545e-06 7.68433e-07 +2.375 3.86498e-06 7.04530e-07 +2.425 3.68502e-06 7.50332e-07 +2.475 3.46489e-06 6.73166e-07 +2.525 3.11345e-06 6.10878e-07 +2.575 2.97394e-06 6.63661e-07 +2.625 2.62476e-06 5.72699e-07 +2.675 2.60534e-06 5.28865e-07 +2.725 2.27288e-06 5.57298e-07 +2.775 2.17230e-06 5.49781e-07 +2.825 2.11770e-06 5.87420e-07 +2.875 1.89851e-06 5.62019e-07 +2.925 1.78394e-06 4.74542e-07 +2.975 1.73459e-06 5.47693e-07 +3.025 1.60458e-06 4.39815e-07 +3.075 1.51367e-06 4.01150e-07 +3.125 1.36585e-06 4.25254e-07 +3.175 1.23599e-06 4.12389e-07 +3.225 1.25606e-06 4.25395e-07 +3.275 1.14221e-06 3.67276e-07 +3.325 1.15169e-06 3.21721e-07 +3.375 9.89132e-07 3.30580e-07 +3.425 9.94492e-07 3.26285e-07 +3.475 8.20824e-07 3.04473e-07 +3.525 8.09533e-07 2.42627e-07 +3.575 7.80451e-07 2.91564e-07 +3.625 7.70439e-07 2.26328e-07 +3.675 7.38784e-07 2.03210e-07 +3.725 7.39050e-07 2.15530e-07 +3.775 6.87191e-07 2.63809e-07 +3.825 6.11774e-07 1.59172e-07 +3.875 5.84561e-07 1.77266e-07 +3.925 6.38652e-07 1.93614e-07 +3.975 5.97843e-07 1.95915e-07 +4.025 5.84100e-07 1.09034e-07 +4.075 5.99947e-07 2.38597e-07 +4.125 5.80897e-07 1.65232e-07 +4.175 5.64639e-07 2.90089e-07 +4.225 6.73398e-07 2.14404e-07 +4.275 6.20875e-07 1.68854e-07 +4.325 6.02270e-07 3.36094e-07 +4.375 6.11524e-07 1.62882e-07 +4.425 6.92455e-07 1.65320e-07 +4.475 4.82357e-07 2.12092e-07 +4.525 5.60784e-07 2.27414e-07 +4.575 1.09160e-06 6.84357e-08 diff --git a/notebooks/STIS/contrast_sensitivity/STIS_Coronagraphic_Observation_Feasibility.ipynb b/notebooks/STIS/contrast_sensitivity/STIS_Coronagraphic_Observation_Feasibility.ipynb new file mode 100644 index 000000000..00e6df354 --- /dev/null +++ b/notebooks/STIS/contrast_sensitivity/STIS_Coronagraphic_Observation_Feasibility.ipynb @@ -0,0 +1,455 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "7ae3f176", + "metadata": {}, + "source": [ + "# STIS Coronagraphic Observation Feasibility" + ] + }, + { + "cell_type": "markdown", + "id": "ba36636e", + "metadata": {}, + "source": [ + "Developed by E. Rickman (erickman@stsci.edu)" + ] + }, + { + "cell_type": "markdown", + "id": "9853658a", + "metadata": {}, + "source": [ + "## Learning Goals" + ] + }, + { + "cell_type": "markdown", + "id": "fe0130ea", + "metadata": {}, + "source": [ + "By the end of this example notebook, you will be able to:\n", + "\n", + "- Plot the contrast sensitivity of a STIS coronagraphic observational set up\n", + "- Assess the detectability of point sources and/or disk around a given target using STIS coronagraphy" + ] + }, + { + "cell_type": "markdown", + "id": "b4e36ff2", + "metadata": {}, + "source": [ + "## Introduction" + ] + }, + { + "cell_type": "markdown", + "id": "aed5b3e5", + "metadata": {}, + "source": [ + "Some of the most important steps in planning and preparing coronagraphic high-contrast observations with STIS involve assessing the feasiblity of a detection of the high-contrast imaging science target (either a point source or a disk) within the capabilities of the predicted contrast sensitivity.\n", + "\n", + "The functions and examples in this notebook are intended to act as a guide to assessing feasibility of high-contrast imaging observations of point sources (i.e. exoplanets, brown dwarf companions) and/or disks around stars for a given expected contrast at the 1, 3 and 5 $\\sigma$ level with STIS coronagraphy." + ] + }, + { + "cell_type": "markdown", + "id": "4aa48f74", + "metadata": {}, + "source": [ + "## Guide to usage" + ] + }, + { + "cell_type": "markdown", + "id": "02a5f16a", + "metadata": {}, + "source": [ + "The purpose of this notebook is to provide a function to assess the direct imaging detectability of point sources and/or disks around stars using STIS coronagraphy. The predicted noise that is estimated for the contrast sensitivity calculation is based on [Debes et al. 2019](https://www.spiedigitallibrary.org/journals/Journal-of-Astronomical-Telescopes-Instruments-and-Systems/volume-5/issue-03/035003/Pushing-the-limits-of-the-coronagraphic-occulters-on-Hubble-Space/10.1117/1.JATIS.5.3.035003.full#_=_), which contains the full explanation of the treatmeant of each of the noise parameters used in this notebook.\n", + "\n", + "The function `plot_contrast` is used to produce a plot showing the predicted contrast sensitivty and takes the following keywords:\n", + " \n", + " inputs\n", + " ------------------\n", + " tsubexp : (float) sub-exposure time in seconds\n", + " texp : (float) total exposure time in seconds (i.e. number of readouts multipled by tsubexp)\n", + " peakpixel_countrate : (float) brightest pixel in a single exposure (count rate in e-/s from the ETC)\n", + " \n", + " optional arguments\n", + " ------------------\n", + " target_name : (str, default=None) the name of the target\n", + " feature : (str, default=None) to display a point source or disk ('companion' or 'disk')\n", + " readnoise : (float, default=8.9) the read noise for the CCD. Default is for the gain setting of 4.\n", + " sdark : (float, default=0.288) the CCD dark current\n", + " szodi : (float, default=2.45) noise from zodiacal dust disk in the Solar System\n", + " searth : (float, default=1.34) noise from scattered light from Earthshine\n", + " comp_sep : (float, default=None) angular separation between host star and point source [\"]\n", + " comp_contrast : (float, default=None) contrast ratio between host star and point source companion\n", + " disk_profile : (str, default=None) profile type of the disk to plot, either 'flat' or 'sb_profile'\n", + " disk_contrast : (float, default=None) contrast ratio between the host star and a disk for flat profile\n", + " disk_filename : (str, default=None) file name to read in surface brightness profile for a disk\n", + " save_fig : (str, default=None) set to True to output and save the figure\n", + " plot_psfintensity : (str, default=True) option to plot the azimuthally averaged STIS PSF intensity\n", + " extract_box_size : (float, default=3) length of the box of the extraction region, default is a 3x3 box\n", + " \n", + "The values for `tsubexp`, `texp`, and `peakpixel_countrate` can be taken directly from the [STIS Exposure Time Calculator](https://etc.stsci.edu/etc/input/stis/imaging/), where a user can input their observational set up to obtain the best estimate for the contrast sensitivity calculation. The image below highlights in green the length of the extraction box (default = 3 pixels, corresponding to a box of 3x3 pixels) and where the `peakpixel_countrate` is taken from for a given observational set up, which is a required input parameter.\n", + "\n", + "The example shown below, for ETC request [1939997](https://etc.stsci.edu/etc/results/STIS.im.1939997/), corresponds to the coronagraphic observing set-up adopted for PID 16991, for the BAR5 occulter, for a V=10.5 mag star. The exposure time for a single frame is `tsubexp` = 440 secs, for a total four frames, giving `texp` = 1760 secs. And the `peakpixel_countrate` in this case is 452,804.530 as highlighted, with the default box extraction size of 3x3 pixels." + ] + }, + { + "cell_type": "markdown", + "id": "4ea85c14", + "metadata": {}, + "source": [ + "![alt text](ETC_example.jpg \"Title\")" + ] + }, + { + "cell_type": "markdown", + "id": "19071603", + "metadata": {}, + "source": [ + "### Loading Data:\n", + "In order to read in a custom surface brightness profile for a disk, a .txt file must be provided. In column 1 the user provides the projected separation in arcseconds (\") and column 2 is the contrast ratio between the host star and the disk.\n", + " \n", + "### Some additional notes:\n", + "- The contrast sensivity calculation is intended as a prediction on the contrast sensitivity limit and does not fully take into the account post-processing techniques that may be used. In [Debes et al. 2019](https://www.spiedigitallibrary.org/journals/Journal-of-Astronomical-Telescopes-Instruments-and-Systems/volume-5/issue-03/035003/Pushing-the-limits-of-the-coronagraphic-occulters-on-Hubble-Space/10.1117/1.JATIS.5.3.035003.full#_=_) the predicted limit for a given observational set up is compared against several post-processing methods.\n", + "- There is an option to plot the azimuthally averaged STIS PSF intensity as provided on the [STIS Instrument Website](https://www.stsci.edu/~STIS/coronagraphic_bars/GO12923raw.dat).\n", + "- The calculation provided here corresponds to the BAR5, WEDGEA0.6, and WEDGEA1.0 aperture locations." + ] + }, + { + "cell_type": "markdown", + "id": "2c931365", + "metadata": {}, + "source": [ + "## Imports" + ] + }, + { + "cell_type": "markdown", + "id": "933c4d99", + "metadata": {}, + "source": [ + "**We will import the following packages:**\n", + "- `numpy` to handle array functions\n", + "- `matplotlib.pyplot` for plotting data" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "8f892bb6", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "520b8fa0", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_contrast(texp, tsubexp, peakpixel_countrate, readnoise=8.9, sdark=0.288, \\\n", + " szodi=2.45, searth=1.34, extract_box_size=3, plot_psfintensity=True, target_name=None, feature=None, \\\n", + " comp_sep = None, comp_contrast=None, disk_profile=None, disk_contrast=None, \\\n", + " disk_filename=None, save_fig=None, **kwargs):\n", + " \"\"\"\n", + " plot_contrast\n", + " ------------------\n", + " Function to plot the contrast sensivity with a point source companion or disk for STIS coronagraphy.\n", + " Displays plot showing 1, 3, and 5 sigma sensitivity curves with the option to plot a companion or disk.\n", + " \n", + " inputs\n", + " ------------------\n", + " tsubexp : (float) sub-exposure time in seconds\n", + " texp : (float) total exposure time in seconds (i.e. number of readouts multipled by tsubexp)\n", + " peakpixel_countrate : (float) brightest pixel in a single exposure (count rate in e-/s from the ETC)\n", + " \n", + " optional arguments\n", + " ------------------\n", + " target_name : (str, default=None) the name of the target\n", + " feature : (str, default=None) to display a point source or disk ('companion' or 'disk')\n", + " readnoise : (float, default=8.9) the read noise for the CCD. Default is for the gain setting of 4.\n", + " sdark : (float, default=0.288) the CCD dark current\n", + " szodi : (float, default=2.45) noise from zodiacal dust disk in the Solar System\n", + " searth : (float, default=1.34) noise from scattered light from Earthshine\n", + " comp_sep : (float, default=None) angular separation between host star and point source [\"]\n", + " comp_contrast : (float, default=None) contrast ratio between host star and point source companion\n", + " disk_profile : (str, default=None) profile type of the disk to plot, either 'flat' or 'sb_profile'\n", + " disk_contrast : (float, default=None) contrast ratio between the host star and a disk for flat profile\n", + " disk_filename : (str, default=None) file name to read in surface brightness profile for a disk\n", + " save_fig : (str, default=None) set to True to output and save the figure\n", + " plot_psfintensity : (str, default=True) option to plot the azimuthally averaged STIS PSF intensity\n", + " extract_box_size : (float, default=3) length of the box of the extraction region, default is a 3x3 box\n", + " \n", + " returns\n", + " ------------------\n", + " Displays figure in line, with option to save figure as an output\n", + " \n", + " \"\"\"\n", + " \n", + " data = np.loadtxt('GO12923raw.dat', usecols=(0,1,2)) \n", + " # This file corresponds to the azimuthally averaged STIS PSF wings, with column 1 being the radius in arcsecs and\n", + " # column 2 is the contrast. This is the PSF intensity that is an optional parameter to plot on the contrast curve.\n", + " rawr =data[:,0]\n", + " rawcont = data[:,1]\n", + " rawcont_error = data[:,2]\n", + " \n", + " spsf = rawcont * peakpixel_countrate # PSF intensity\n", + "\n", + " n2det = extract_box_size * tsubexp * (sdark + (readnoise)**2/texp) # detector noise^2\n", + "\n", + " n2bkg = extract_box_size * tsubexp * (szodi + searth) # background noise^2\n", + "\n", + " n2poiss = extract_box_size * tsubexp * spsf # poission noise^2\n", + "\n", + " spec_int = 0.00128*(rawr/0.05071)**(-2.86) \n", + " #empirical fit to the average speckle intensity as a function of radius (Debes et al. 2019)\n", + "\n", + " n2spec = (spec_int*tsubexp)**2 * peakpixel_countrate**2 * extract_box_size**2 * tsubexp/texp # speckle noise\n", + "\n", + " totnoise_5sigma = 5*np.sqrt(2*n2det + 2*n2bkg + 2*n2poiss + 2*n2spec) # 5 sigma total noise\n", + " totnoise_3sigma = 3*np.sqrt(2*n2det + 2*n2bkg + 2*n2poiss + 2*n2spec) # 3 sigma total noise\n", + " totnoise_1sigma = 1*np.sqrt(2*n2det + 2*n2bkg + 2*n2poiss + 2*n2spec) # 1 sigma total noise\n", + " # the factor of 2 in each of the noise calculations comes from adding the noise component from \n", + " # both a reference PSF and a science PSF\n", + "\n", + " cperpix_5sigma = totnoise_5sigma / (peakpixel_countrate/0.23*0.5*tsubexp) # calculating the contrast per pixel \n", + " cperpix_3sigma = totnoise_3sigma / (peakpixel_countrate/0.23*0.5*tsubexp)\n", + " cperpix_1sigma = totnoise_1sigma / (peakpixel_countrate/0.23*0.5*tsubexp)\n", + " \n", + " contrast_plot = plt.figure(figsize=(14,10))\n", + "\n", + " plt.plot(rawr, cperpix_5sigma, label = 'Predicted Limit 5$\\sigma$', color='lightsteelblue')\n", + " plt.plot(rawr, cperpix_3sigma, label = 'Predicted Limit 3$\\sigma$', color='steelblue')\n", + " plt.plot(rawr, cperpix_1sigma, label = 'Predicted Limit 1$\\sigma$', color='midnightblue')\n", + "\n", + " plt.fill_between(rawr, cperpix_5sigma, color='lightsteelblue')\n", + " plt.fill_between(rawr, cperpix_3sigma, color='steelblue')\n", + " plt.fill_between(rawr, cperpix_1sigma, color='midnightblue')\n", + "\n", + " if plot_psfintensity == True: # option to plot the PSF intensity on the contrast plot\n", + " plt.plot(rawr, rawcont, ls='--', label = 'PSF Intensity', color='black', linewidth=2)\n", + " else:\n", + " None \n", + " \n", + " if feature == 'companion':\n", + " if 'comp_sep' == None or 'comp_contrast' == None:\n", + " raise NameError(\"Companion separation ('comp_sep') or companion contrast ('comp_contrast') or not specified.\") \n", + " comp_separation = comp_sep\n", + " comp_contrast = comp_contrast\n", + " target_name = target_name\n", + " plt.plot(comp_separation, comp_contrast, '*', markersize=40, color='orange', label=target_name)\n", + " \n", + " elif feature == 'disk':\n", + " #if 'disk_profile' == None:\n", + " # raise NameError(\"Disk surface brightness profile not specified. Must be either 'flat' or 'sb_profile'.\")\n", + " \n", + " diskprofile = disk_profile\n", + " \n", + " if diskprofile == 'flat':\n", + " if 'disk_contrast' == None:\n", + " raise NameError(\"Disk contrast not specified.\")\n", + " diskcontrast = disk_contrast\n", + " plt.axhline(diskcontrast, ls='--', linewidth=4, color='orange', label=target_name)\n", + " \n", + " elif diskprofile == 'sb_profile':\n", + " if 'disk_filename' == None:\n", + " raise NameError(\"Surface brightness profile file name is not specified.\")\n", + " \n", + " diskfilename = disk_filename\n", + " disk_sb_profile = np.loadtxt(diskfilename, usecols=(0,1)) # contrast as a function of radius, rawr here is in arcsecs\n", + " disk_r = disk_sb_profile[:,0]\n", + " disk_cont = disk_sb_profile[:,1] \n", + " plt.plot(disk_r, disk_cont, ls='--', linewidth=4, color='orange', label=target_name)\n", + " \n", + " elif diskprofile == None:\n", + " None\n", + " \n", + " else:\n", + " raise NameError(\"Disk profile not specified. Must be either 'flat' or 'sb_profile'.\")\n", + " \n", + " elif feature == None:\n", + " None\n", + " \n", + " plt.legend(fontsize=18, loc='best', markerscale=0.5)\n", + " plt.xlabel('Separation (\")', fontsize=20)\n", + " plt.ylabel('Contrast Sensitivity', fontsize=20)\n", + " plt.xlim(0.2,1.2)\n", + " plt.yscale('log')\n", + " plt.tick_params(axis='both', which='both', labelsize=20, size=6)\n", + " \n", + " if 'save_fig' not in kwargs:\n", + " None\n", + " else:\n", + " savefig=kwargs['save_fig']\n", + " if savefig == True:\n", + " contrast_plot.savefig('STIS_contrast_plot_'+target_name+'.pdf')" + ] + }, + { + "cell_type": "markdown", + "id": "e8da31aa", + "metadata": {}, + "source": [ + "## Example #1: A point source companion" + ] + }, + { + "cell_type": "markdown", + "id": "9f7d7b84", + "metadata": {}, + "source": [ + "In the example below, is a test case demonstration for a theoretical point source companion in close angular separation to a bright star where the property values of a companion are defined in-line in the function call directly.\n", + "\n", + "- The point source example companion plotted here is shown at 0.6\" projected angular separation from it central star at a contrast ratio of 2e-5.\n", + "- The dark blue corresponds to the point source companion being under the 1$\\sigma$ direct detection limit. \n", + "- The medium blue corresponds to the parameter space of detectability within the 1-3$\\sigma$ regime.\n", + "- The light blue corresponds to the parameter space of detectability within the 3-5$\\sigma$ regime.\n", + "- Anything above the light blue 5$\\sigma$ contrast limit in the white region would be predicted to be detectable with the given observational set up.\n", + "- The black dotted line shows the azimuthally averaged STIS PSF intensity for comparison, which is the expected contrast curve without coronagraphic post-processing techniques applied, and is an optional parameter to plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ecb316c", + "metadata": {}, + "outputs": [], + "source": [ + "plot_contrast(tsubexp=440.0, texp=1760.0, peakpixel_countrate=452804.530, comp_sep=0.6, comp_contrast=2e-5, feature='companion', target_name='companion name')" + ] + }, + { + "cell_type": "markdown", + "id": "1a234d5b", + "metadata": {}, + "source": [ + "## Example #2: A flat disk " + ] + }, + { + "cell_type": "markdown", + "id": "18d7f3e9", + "metadata": {}, + "source": [ + "In the example below, the property values of a disk are defined in-line in the function call directly. The resulting figure shows the predicted contrast sensitivity at the 1, 3, and 5 $\\sigma$ level as a function of the radius away from the central star in arcseconds [\"], with the contrast value of the disk plotted as a horizontal line to represent a predicted peak contrast value for a disk.\n", + "\n", + "- The flat disk profile shown as the dotted orange line is plotted with at a contrast ratio of 1e-5.\n", + "- The dark blue corresponds to the disk brightness being under the 1$\\sigma$ direct detection limit, and therefore in this case you would not be confident in being able to directly detect the disk at close to the inner working angle with the given observational set up. \n", + "- The medium blue corresponds to the parameter space of detectability within the 1-3$\\sigma$ regime.\n", + "- The light blue corresponds to the parameter space of detectability within the 3-5$\\sigma$ regime.\n", + "- Anything above the light blue 5$\\sigma$ contrast limit in the white region would be predicted to be detectable with the given observational set up.\n", + "- The black dotted line shows the azimuthally averaged STIS PSF intensity for comparison, and is an optional parameter to plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd17d3ac", + "metadata": { + "scrolled": false + }, + "outputs": [], + "source": [ + "plot_contrast(tsubexp=440.0, texp=1760.0, peakpixel_countrate=452804.530, feature='disk', disk_profile='flat', disk_contrast=1e-5, target_name='flat disk')" + ] + }, + { + "cell_type": "markdown", + "id": "6337ec02", + "metadata": {}, + "source": [ + "## Example #3: A disk with a surface brightness profile" + ] + }, + { + "cell_type": "markdown", + "id": "68acbd75", + "metadata": {}, + "source": [ + "In the example below, the property values of a disk are defined with a .txt file with a column of radius away from the host star in arcseconds and a second column with the contrast ratio. The resulting figure shows the predicted contrast sensitivity at the 1, 3, and 5 $\\sigma$ level as a function of the radius away from the central star in arcseconds [\"], with the surface brightness profile of the disk from the .txt file plotted.\n", + "\n", + "- The surface brightness disk profile shown as the dotted orange line is read in from a .txt file.\n", + "- Anything in the dark blue corresponds to the disk brightness being under the 1$\\sigma$ detection limit, and therefore you would not be confident in being able to directly detect the disk at close to the inner working angle with the given observational set up. \n", + "- The medium blue corresponds to the parameter space of detectability within the 1-3$\\sigma$ regime.\n", + "- The light blue corresponds to the parameter space of detectability within the 3-5$\\sigma$ regime.\n", + "- Anything above the light blue 5$\\sigma$ contrast limit in the white region would be predicted to be detectable with the given observational set up.\n", + "- The black dotted line shows the azimuthally averaged STIS PSF intensity for comparison, and is an optional parameter to plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2c6972ed", + "metadata": {}, + "outputs": [], + "source": [ + "plot_contrast(tsubexp=440.0, texp=1760.0, peakpixel_countrate=452804.530, feature='disk', disk_profile='sb_profile', disk_filename='TWHya.txt', target_name='TWHya')" + ] + }, + { + "cell_type": "markdown", + "id": "fc5d9f9a", + "metadata": {}, + "source": [ + "## Acknowledgements and References" + ] + }, + { + "cell_type": "markdown", + "id": "c4f18c65", + "metadata": {}, + "source": [ + "This notebook has been developed with support from John Debes in reference to [Debes et al. 2019](https://www.spiedigitallibrary.org/journals/Journal-of-Astronomical-Telescopes-Instruments-and-Systems/volume-5/issue-03/035003/Pushing-the-limits-of-the-coronagraphic-occulters-on-Hubble-Space/10.1117/1.JATIS.5.3.035003.full#_=_)." + ] + }, + { + "cell_type": "markdown", + "id": "79d51be0", + "metadata": {}, + "source": [ + "Author: Emily Rickman, ESA Science Operations Scientist. \\\n", + "Updated On: 2024-10-24" + ] + }, + { + "cell_type": "markdown", + "id": "ebbc5703", + "metadata": {}, + "source": [ + "\"Space" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "stis", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/STIS/contrast_sensitivity/requirements.txt b/notebooks/STIS/contrast_sensitivity/requirements.txt new file mode 100644 index 000000000..806f22116 --- /dev/null +++ b/notebooks/STIS/contrast_sensitivity/requirements.txt @@ -0,0 +1,2 @@ +numpy +matplotlib \ No newline at end of file