Skip to content

Commit

Permalink
adding NIRISS imaging pipeline tutorial notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
slamassa committed Jan 23, 2024
1 parent 7832a11 commit 35a1980
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions notebooks/niriss_imaging/niriss-imaging-tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"id": "dc6b2aba-072e-4179-a856-29d547f277d6",
"metadata": {},
"source": [
"# <a id='intro'>1. Introduction</a>\n",
"## <a id='intro'>1. Introduction</a>\n",
"In this notebook, we will process a [NIRISS imaging dataset](https://jwst-docs.stsci.edu/jwst-near-infrared-imager-and-slitless-spectrograph/niriss-observing-modes/niriss-imaging) through the [JWST calibration pipeline](https://jwst-docs.stsci.edu/jwst-science-calibration-pipeline-overview). The example dataset is from [Program ID](https://www.stsci.edu/jwst/science-execution/program-information) 1475 (PI: Boyer, CoI: Volk) which is a sky flat calibration program. NIRCam is used as the primary instrument with NIRISS as a [coordinated parallel instrument](https://jwst-docs.stsci.edu/methods-and-roadmaps/jwst-parallel-observations/jwst-coordinated-parallels-roadmap). The NIRISS imaging dataset uses a 17-step dither pattern.\n",
"\n",
"For illustrative purposes, we focus on data taken through the NIRISS [F150W filter](https://jwst-docs.stsci.edu/jwst-near-infrared-imager-and-slitless-spectrograph/niriss-instrumentation/niriss-filters) and start with uncalibrated data products. The files are named\n",
Expand All @@ -35,7 +35,7 @@
"id": "026a649d-a0d2-4e3f-ab6d-cf8c26e6ce1d",
"metadata": {},
"source": [
"## Install pipeline and dependencies"
"### Install pipeline and dependencies"
]
},
{
Expand All @@ -50,7 +50,7 @@
"pip install jdaviz --upgrade\n",
"```\n",
"\n",
"## Imports"
"### Imports"
]
},
{
Expand Down Expand Up @@ -90,7 +90,7 @@
"id": "459d06b6-4f6a-402c-85a8-d06715a3d9e5",
"metadata": {},
"source": [
"## Define program parameters\n",
"### Define program parameters\n",
"\n",
"These will be used for generating the assocation file for Stage 3"
]
Expand All @@ -114,7 +114,7 @@
"metadata": {},
"source": [
"***\n",
"# <a id='examine'>2. Examining uncalibrated data products</a>"
"## <a id='examine'>2. Examining uncalibrated data products</a>"
]
},
{
Expand All @@ -132,7 +132,7 @@
"id": "dca6413e-6a91-40c1-9bfa-0ebf78e6431b",
"metadata": {},
"source": [
"## Look at the first file to determine exposure parameters and practice using JWST datamodels"
"### Look at the first file to determine exposure parameters and practice using JWST datamodels"
]
},
{
Expand Down Expand Up @@ -174,7 +174,7 @@
"id": "46be5421-7fc8-4d96-b2cd-2484f294e082",
"metadata": {},
"source": [
"## Display uncalibrated image\n",
"### Display uncalibrated image\n",
"\n",
"We can visualize an uncalibrated dataset that will show detector artifacts that will be removed when calibrating the data through the `DETECTOR1` stage of the pipeline. Uncalibrated data files thus are 4D: nintegrations x ngroups x nrows x ncols. Here, we are visualizing the full detector (i.e., all columns and rows) and the 1st group.\n",
"\n",
Expand Down Expand Up @@ -228,7 +228,7 @@
"metadata": {},
"source": [
"***\n",
"# <a id='det1'>3. Stage 1 Processing </a>\n",
"## <a id='det1'>3. Stage 1 Processing </a>\n",
"Run the datasets through the [Detector1 stage of the pipeline](https://jwst-docs.stsci.edu/jwst-science-calibration-pipeline-overview/stages-of-jwst-data-processing/calwebb_detector1) to apply detector level calibrations and create a countrate data product where slopes are fitted to the integration ramps. These `*_rate.fits` products are 2D (nrows x ncols), averaged over all integrations. 3D countrate data products (`*_rateints.fits`) are also created (nintegrations x nrows x ncols) which have the fitted ramp slopes for each integration.\n",
"\n",
"The [pipeline documentation](https://jwst-pipeline.readthedocs.io/en/latest/jwst/user_documentation/running_pipeline_python.html) discusses how to run the pipeline in the Python Interface, including how to configure pipeline steps and override reference files. By returning the results of the pipeline to a variable, the pipeline returns a datamodel. Note that the [`pipeline.call()` method is preferred over the `pipeline.run()` method](https://jwst-pipeline.readthedocs.io/en/latest/jwst/user_documentation/running_pipeline_python.html#advanced-use-pipeline-run-vs-pipeline-call).\n",
Expand Down Expand Up @@ -276,7 +276,7 @@
"id": "7fc5520a-6097-482b-b3e0-a6bf94cf7af3",
"metadata": {},
"source": [
"## Identify `*_rate.fits` files"
"### Identify `*_rate.fits` files"
]
},
{
Expand All @@ -294,7 +294,7 @@
"id": "f5845ca6-5280-489b-a1da-c2267857d034",
"metadata": {},
"source": [
"## Verify which pipeline steps were run and which calibration reference files were applied\n",
"### Verify which pipeline steps were run and which calibration reference files were applied\n",
"\n",
"The header contains information about which calibration steps were completed and skipped and which reference files were used to process the data."
]
Expand Down Expand Up @@ -335,7 +335,7 @@
"id": "3ff813f4-f9d6-4765-b882-48f954b8969d",
"metadata": {},
"source": [
"## Display rate image\n",
"### Display rate image\n",
"\n",
"Visualize a countrate image, using the dataset from the first dither position as an example."
]
Expand Down Expand Up @@ -379,7 +379,7 @@
"metadata": {},
"source": [
"***\n",
"# <a id='image2'>3. Stage 2 Processing </a>\n",
"## <a id='image2'>3. Stage 2 Processing </a>\n",
"\n",
"In the [Image2 stage of the pipeline](https://jwst-pipeline.readthedocs.io/en/latest/jwst/pipeline/calwebb_image2.html), calibrated unrectified data products are created (`*_cal.fits` or `*_calints.fits` files, depending on whether the input files are `*_rate.fits` or `*_rateints.fits`). \n",
"\n",
Expand Down Expand Up @@ -418,7 +418,7 @@
"id": "75b26730-40b9-4ea7-a6ad-47727f00e401",
"metadata": {},
"source": [
"## Identify `*_cal.fits` files"
"### Identify `*_cal.fits` files"
]
},
{
Expand All @@ -436,7 +436,7 @@
"id": "da57b7d0-95ef-4227-b730-6f54a3eaaa16",
"metadata": {},
"source": [
"## Verify which pipeline steps were run"
"### Verify which pipeline steps were run"
]
},
{
Expand Down Expand Up @@ -474,7 +474,7 @@
"id": "19b9d7e4-536c-4661-ac9a-d21e7daf1389",
"metadata": {},
"source": [
"## Display cal image\n",
"### Display cal image\n",
"\n",
"Visualize a calibrated image, using the dataset from the first dither position as an example."
]
Expand Down Expand Up @@ -518,7 +518,7 @@
"metadata": {},
"source": [
"***\n",
"# <a id='image3'>3. Stage 3 Processing </a>\n",
"## <a id='image3'>3. Stage 3 Processing </a>\n",
"\n",
"In the [Image3 stage of the pipeline](https://jwst-pipeline.readthedocs.io/en/latest/jwst/pipeline/calwebb_image3.html), the individual `*_cal.fits` files for each of the dither positions are combined to one single distortion corrected image. First, an [Association](https://jwst-pipeline.readthedocs.io/en/latest/jwst/associations/overview.html) needs to be created to inform the pipeline that these individual exposures are linked together. \n",
"\n",
Expand All @@ -537,7 +537,7 @@
"id": "db5cb6f5-44a1-4f28-95dc-b23a97451465",
"metadata": {},
"source": [
"## Create Association File\n",
"### Create Association File\n",
"\n",
"An association file lists the exposures to calibrated together in `Stage 3` of the pipeline. Note that an association file is available for download from MAST, with a filename of `*_asn.json`. Here we show how to create an association file to point to the data products created when processing data through the pipeline. Note that the output products will have a rootname that is specified by the `product_name` in the association file. For this tutorial, the rootname of the output products will be `image3_association`."
]
Expand Down Expand Up @@ -570,7 +570,7 @@
"id": "629cad5b-e5a7-473e-8583-ad12cda55fa4",
"metadata": {},
"source": [
"## Run Image3 stage of the pipeline\n",
"### Run Image3 stage of the pipeline\n",
"\n",
"Given the grouped exposures in the association file, the `Image3` stage of the pipeline will produce:\n",
"- a `*_cr.fits` file produced by the `outlier_detection` step, where the `DQ` array marks the pixels flagged as outliers.\n",
Expand Down Expand Up @@ -605,7 +605,7 @@
"id": "4bcb6c40-fbb8-4226-b620-64b0c02c8ceb",
"metadata": {},
"source": [
"## Verify which pipeline steps were run"
"### Verify which pipeline steps were run"
]
},
{
Expand Down Expand Up @@ -645,7 +645,7 @@
"id": "8d44a0de-774a-4d63-8de9-80a9c6aa24b2",
"metadata": {},
"source": [
"## Display combined image\n",
"### Display combined image\n",
"\n",
"Visualize the drizzle-combined image."
]
Expand Down Expand Up @@ -688,7 +688,7 @@
"id": "018733eb-07ec-44a4-a5a7-d6d2f27d193a",
"metadata": {},
"source": [
"# <a id='detections'>Visualize Detected Sources</a>\n",
"## <a id='detections'>Visualize Detected Sources</a>\n",
"Using the source catalog created by the `IMAGE3` stage of the pipeline, mark the detected sources, using different markers for point sources and extended sources. The source catalog is saved in `image3/image3_association_cat.ecsv` file. We will need to read in the `i2d` file again to make sure the world coordinate system (WCS) info is read in."
]
},
Expand All @@ -697,7 +697,7 @@
"id": "2ad6ee55-f940-4be3-96c9-114bc83eb784",
"metadata": {},
"source": [
"## Read in catalog file and identify point/extended sources"
"### Read in catalog file and identify point/extended sources"
]
},
{
Expand Down Expand Up @@ -726,7 +726,7 @@
"id": "be9e9069-375d-431b-bbfb-e84e6cefc2d4",
"metadata": {},
"source": [
"## Mark the extended and point sources on the image\n",
"### Mark the extended and point sources on the image\n",
"\n",
"Display combined image:"
]
Expand Down Expand Up @@ -811,7 +811,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 35a1980

Please sign in to comment.