|
5 | 5 | "id": "0393e357-9d9d-4516-b28d-4d335fad33a0",
|
6 | 6 | "metadata": {},
|
7 | 7 | "source": [
|
8 |
| - "# Baseline: NIRISS Imaging Tutorial Notebook\n", |
| 8 | + "# Advanced: NIRISS Imaging Tutorial Notebook\n", |
9 | 9 | "\n",
|
10 | 10 | "## Table of Contents\n",
|
11 | 11 | "1. [Introduction](#intro)\n",
|
12 | 12 | "2. [Examining uncalibrated data products](#examine)\n",
|
13 | 13 | "3. [Stage 1 Processing](#det1)\n",
|
14 | 14 | "4. [Stage 2 Processing](#image2)\n",
|
15 | 15 | "5. [Stage 3 Processing](#image3)\n",
|
16 |
| - "6. [Visualize Detected Sources](#detections)" |
| 16 | + "6. [Visualize Detected Sources](#detections)\n", |
| 17 | + "\n", |
| 18 | + "Date published: January 24, 2024" |
17 | 19 | ]
|
18 | 20 | },
|
19 | 21 | {
|
|
62 | 64 | "source": [
|
63 | 65 | "import os\n",
|
64 | 66 | "import glob\n",
|
| 67 | + "import zipfile\n", |
| 68 | + "import urllib.request\n", |
65 | 69 | "import numpy as np\n",
|
66 | 70 | "\n",
|
67 | 71 | "# for JWST calibration pipeline\n",
|
|
91 | 95 | "id": "459d06b6-4f6a-402c-85a8-d06715a3d9e5",
|
92 | 96 | "metadata": {},
|
93 | 97 | "source": [
|
94 |
| - "### Define program parameters\n", |
95 |
| - "\n", |
96 |
| - "These will be used for generating the assocation file for Stage 3" |
| 98 | + "### Download uncalibrated data products" |
97 | 99 | ]
|
98 | 100 | },
|
99 | 101 | {
|
|
106 | 108 | "# APT program ID number:\n",
|
107 | 109 | "pid = '01475'\n",
|
108 | 110 | "\n",
|
109 |
| - "data_dir = '1475_f150w/'" |
| 111 | + "# Set up directory to download uncalibrated data files:\n", |
| 112 | + "data_dir = '1475_f150w/'\n", |
| 113 | + "# Create directory if it does not exist\n", |
| 114 | + "if not os.path.isdir(data_dir):\n", |
| 115 | + " os.mkdir(data_dir)\n", |
| 116 | + "\n", |
| 117 | + "# Download uncalibrated data from Box into current directory:\n", |
| 118 | + "boxlink = 'https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/niriss_imaging/1475_f150w.zip'\n", |
| 119 | + "boxfile = os.path.join(data_dir, '1475_f150w.zip')\n", |
| 120 | + "urllib.request.urlretrieve(boxlink, boxfile)\n", |
| 121 | + "\n", |
| 122 | + "zf = zipfile.ZipFile(boxfile, 'r')\n", |
| 123 | + "zf.extractall()" |
110 | 124 | ]
|
111 | 125 | },
|
112 | 126 | {
|
|
386 | 400 | "\n",
|
387 | 401 | "In this pipeline processing stage, the [world coordinate system (WCS)](https://jwst-pipeline.readthedocs.io/en/latest/jwst/assign_wcs/index.html#assign-wcs-step) is assigned, the data are [flat fielded](https://jwst-pipeline.readthedocs.io/en/latest/jwst/flatfield/index.html#flatfield-step), and a [photometric calibration](https://jwst-pipeline.readthedocs.io/en/latest/jwst/photom/index.html#photom-step) is applied to convert from units of countrate (ADU/s) to surface brightness (MJy/sr). \n",
|
388 | 402 | "\n",
|
389 |
| - "By default, the [background subtraction step](https://jwst-pipeline.readthedocs.io/en/latest/jwst/background_step/index.html#background-step) and the [resampling step](https://jwst-pipeline.readthedocs.io/en/latest/jwst/resample/index.html#resample-step) are turned off for NIRISS at this stage of the pipeline." |
| 403 | + "By default, the [background subtraction step](https://jwst-pipeline.readthedocs.io/en/latest/jwst/background_step/index.html#background-step) and the [resampling step](https://jwst-pipeline.readthedocs.io/en/latest/jwst/resample/index.html#resample-step) are turned off for NIRISS at this stage of the pipeline. The background subtraction is turned off since there is no background template for the imaging mode and the local background is removed during the background correction for photometric measurements around individual sources. The resampling step occurs during the `Image3` stage by default. While the resampling step can be turned on during the `Image2` stage to, e.g., generate a source catalog for each image, the data quality from the `Image3` stage will be better since the bad pixels, which adversely affect both the centroids and photometry in individual images, will be mostly removed." |
390 | 404 | ]
|
391 | 405 | },
|
392 | 406 | {
|
|
523 | 537 | "\n",
|
524 | 538 | "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",
|
525 | 539 | "\n",
|
526 |
| - "By default, the `IMAGE3` stage of the pipeline performs the following steps on NIRISS data: \n", |
| 540 | + "By default, the `Image3` stage of the pipeline performs the following steps on NIRISS data: \n", |
527 | 541 | "- [tweakreg](https://jwst-pipeline.readthedocs.io/en/latest/jwst/tweakreg/index.html#tweakreg-step) - creates source catalogs of pointlike sources for each input image. The source catalog for each input image is compared to each other to derive coordinate transforms to align the images relative to each other.\n",
|
528 | 542 | " - As of CRDS context `jwst_1156.pmap` and later, the `pars-tweakreg` parameter reference file for NIRISS performs an absolute astrometric correction to GAIA data release 3 by default (i.e., the `abs_refcat` parameter is set to `GAIADR3`). Though this default correction generally improves results compared with not doing this alignment, it can sometimes result in poor performance in crowded or sparse fields, so users are encouraged to check astrometric accuracy and revisit this step if necessary.\n",
|
529 | 543 | " - As of pipeline version 1.12.5, the default source finding algorithm is `DAOStarFind` which can result in up to 0.5 pix uncertainties in the centroids for undersampled PSFs, like the NIRISS PSFs at short wavelengths [(Goudfrooij 2022)](https://www.stsci.edu/files/live/sites/www/files/home/jwst/documentation/technical-documents/_documents/JWST-STScI-008116.pdf). There are plans to update the default algorithm to `IRAFStarFind` in future pipeline versions.\n",
|
530 | 544 | "- [skymatch](https://jwst-pipeline.readthedocs.io/en/latest/jwst/skymatch/index.html#skymatch-step) - measures the background level from the sky to use as input into the subsequent `outlier detection` and `resample` steps.\n",
|
531 | 545 | "- [outlier detection](https://jwst-pipeline.readthedocs.io/en/latest/jwst/outlier_detection/index.html#outlier-detection-step) - flags any remaining cosmic rays, bad pixels, or other artifacts not already flagged during the `DETECTOR1` stage of the pipeline, using all input images to create a median image so that outliers in individual images can be identified.\n",
|
532 | 546 | "- [resample](https://jwst-pipeline.readthedocs.io/en/latest/jwst/resample/index.html#resample-step) - resamples each input image based on its WCS and distortion information and creates a single undistorted image.\n",
|
533 |
| - "- [source catalog](https://jwst-pipeline.readthedocs.io/en/latest/jwst/source_catalog/index.html#source-catalog-step) - creates a catalog of detected sources along with measured photometries and morphologies (i.e., point-like vs extended). Useful for quicklooks, but optimization is likely needed for specific science cases.\n" |
| 547 | + "- [source catalog](https://jwst-pipeline.readthedocs.io/en/latest/jwst/source_catalog/index.html#source-catalog-step) - creates a catalog of detected sources along with measured photometries and morphologies (i.e., point-like vs extended). Useful for quicklooks, but optimization is likely needed for specific science cases, which is an on-going investigation for the NIRISS team. Users may wish to experiment with changing the `snr_threshold` and `deblend` options. Modifications to the following parameters will not significantly improve data quality and it is advised to keep them at their default values: `aperture_ee1`, `aperture_ee2`, `aperture_ee3`, `ci1_star_threshold`, `ci2_star_threshold`.\n" |
534 | 548 | ]
|
535 | 549 | },
|
536 | 550 | {
|
|
749 | 763 | "viewer_cat.set_colormap('Viridis')\n",
|
750 | 764 | "viewer_cat.cuts = '95%'\n",
|
751 | 765 | "\n",
|
752 |
| - "\n", |
753 | 766 | "imviz_cat.show()"
|
754 | 767 | ]
|
755 | 768 | },
|
|
0 commit comments