Skip to content

Commit 6883f6d

Browse files
committed
downloading wisp templates from jdat box folder
1 parent e821c8a commit 6883f6d

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

notebooks/NIRCam/NIRCam_wisp_subtraction/nircam_wisp_subtraction.ipynb

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"source": [
4646
"This notebook demonstrates how to remove [wisps](https://jwst-docs.stsci.edu/known-issues-with-jwst-data/nircam-known-issues/nircam-scattered-light-artifacts#NIRCamScatteredLightArtifacts-wispsWisps) from NIRCam imaging data. Wisps are a scattered light feature affecting detectors A3, A4, B3, and B4. For a given filter, wisps appear in the same detector location with only their brightness varying between exposures; therefore, they can be removed from science data by scaling and subtracting a wisp template (i.e. a median combination of all wisp appearances).\n",
4747
"\n",
48-
"Wisp templates used by this notebook are available in the version3 folder in the [NIRCam wisp template Box folder](https://stsci.box.com/s/1bymvf1lkrqbdn9rnkluzqk30e8o2bne). For this notebook, only the F200W templates are needed (i.e. WISP_NRCA3_F200W_CLEAR.fits, WISP_NRCA4_F200W_CLEAR.fits, WISP_NRCB3_F200W_CLEAR.fits and WISP_NRCB4_F200W_CLEAR.fits).\n",
48+
"The wisp templates used in this notebook will be downloaded in the [Data](#data) section, but they are also available in the \"version3\" folder within the [NIRCam wisp template Box folder](https://stsci.box.com/s/1bymvf1lkrqbdn9rnkluzqk30e8o2bne). Future updates to these templates will be added to this same Box folder, and users are encouraged to check this folder regularly to ensure they have the latest version.\n",
4949
"\n",
5050
"This notebook uses the `subtract_wisp.py` code to scale and subtract the wisps. That code can be used by itself within python, and is preferred if calibrating a large number of files in parallel, but this notebook will be used to demonstrate the various parameters available to optimize wisp removal. For each notebook cell, we'll also show the corresponding command to run the equivalent in python."
5151
]
@@ -78,7 +78,8 @@
7878
"from astroquery.mast import Mast, Observations\n",
7979
"import glob\n",
8080
"import matplotlib.pyplot as plt\n",
81-
"%matplotlib inline"
81+
"%matplotlib inline\n",
82+
"import urllib"
8283
]
8384
},
8485
{
@@ -120,6 +121,30 @@
120121
" result = Observations().download_file(row['dataURI'], cache=False)"
121122
]
122123
},
124+
{
125+
"cell_type": "markdown",
126+
"id": "2faab36d-49a8-4877-b4eb-4693ce665de1",
127+
"metadata": {},
128+
"source": [
129+
"Next, we'll download the wisp templates. These templates are equivalent to those in the \"version3\" folder within the [NIRCam wisp template Box folder](https://stsci.box.com/s/1bymvf1lkrqbdn9rnkluzqk30e8o2bne). Users are encouraged to check this folder regularly for any updates. For this notebook, only the F200W templates are needed (i.e. WISP_NRCA3_F200W_CLEAR.fits, WISP_NRCA4_F200W_CLEAR.fits, WISP_NRCB3_F200W_CLEAR.fits and WISP_NRCB4_F200W_CLEAR.fits)."
130+
]
131+
},
132+
{
133+
"cell_type": "code",
134+
"execution_count": null,
135+
"id": "641cd018-8760-47fb-beb2-a4f0d9a11061",
136+
"metadata": {},
137+
"outputs": [],
138+
"source": [
139+
"# Download the wisp templates\n",
140+
"\n",
141+
"boxlink = 'https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_wisp_templates/'\n",
142+
"\n",
143+
"for detector in ['NRCA3', 'NRCA4', 'NRCB3', 'NRCB4']:\n",
144+
" boxfile = os.path.join(boxlink, 'WISP_{}_F200W_CLEAR.fits'.format(detector))\n",
145+
" urllib.request.urlretrieve(boxfile, os.path.basename(boxfile))"
146+
]
147+
},
123148
{
124149
"cell_type": "markdown",
125150
"id": "4ee4c38e-d86d-4096-833e-9e92a87cb78a",

0 commit comments

Comments
 (0)