Data Analysis Example Jupyter Notebooks

A series of Jupyter Notebooks have been created to illustrate workflows for analyzing JWST data.  

See Also: Notebooks Landing Page, Notebooks GitHub Page, All Notebooks (including Pipeline and Demo)

Words in bold italics are also buttons 
or parameters in GUI tools. Bold 
style represents GUI menus/
panels & data software packages.

A series of example Jupyter notebooks have been built to demonstrate expected science workflows using various JWST observing modes. While focused on JWST, they show useful workflows for analyzing data from other observatories as well. The notebooks utilize Astropy packages and the Jdaviz visualization tools when possible.  These notebooks can be downloaded and executed by cloning the GitHub repository to your local computer. The documentation contains detailed instructions for installing the notebooks, as well as rendered versions of the notebooks that allow you to view in your browser without downloading.

Notebooks may be in various stages. Typically, a baseline notebook will have the general science workflow outlined and implemented by the software tools available at this time. An "advanced" notebook will have some combination of the following: (a) improved software functionality to streamline the science workflow, (b) utilization of Jdaviz for visualization and interactive analysis, and (c) integration with JWST simulated or real data.

In addition to the notebooks below, STScI has generated a series of other notebooks to demonstrate related workflows, including running the pipeline and running Jdaviz. See the Sample Notebooks page documentation within Jdaviz for a complete list.


Table 1. JWST Jupyter notebooks

Notebook DescriptionNotebook Stage
General
Baseline
asdf
  • Use case: create ASDF (Advanced Scientific Data Format) file from FITS file
  • Data: CANDELS image of the COSMOS field
  • Tools: asdf, gwcs, astrocut
  • Cross-instrument: all instruments
Baseline
Background Estimation
  • Use case: estimate the sky background in complex scenes and evaluate the quality of the sky estimation
  • Data: images with pathological background pattern created in the notebook
  • Tools: Photutils
  • Cross-instrument: all instruments
Baseline
Redshift Cross-Correlation
  • Use case: reproduce the workflow of the IRAF task XCORFIT to measure redshift with a cross-correlation algorithm
  • Data: LEGA-C spectra and galaxy template spectra; optical rest-frame
  • Tools: Specutils
  • Cross-instrument: all instruments
Baseline
Composite Model Spectral Fitting
  • Use case: Fitting the complex continuum around Lyman-alpha in the spectrum of an active galaxy NGC 5548.
  • Data: 3-column ECSV file with units for each column.
  • Tools: Specutils, numpy
  • Cross-instrument: all spectra
Baseline
Querying MAST
  • Use case: How to submit a NIRSpec MAST query using Python, and how to perform checks for potential duplication issues with any given targets by comparing with pre-existing MAST data 
  • Data: 
  • Tools: MAST, Astroquery
  • Cross-instrument: created for NIRSpec, but good for all instruments
Baseline
Specviz GUI Interaction
  • Use case: How to inspect spectra in Specviz, export spectra from the GUI in the notebook, select regions in the GUI and in the notebook, and measure the redshift of a source in the GUI 
  • Data: NIRISS simulation of a generic scene with extended sources generated with the code MIRAGE
  • Tools: Specutils, Jdaviz
  • Cross-instrument: created for NIRISS, but good for all instruments
Baseline
NIRCam
Baseline
Point Source Aperture Photometry
  • Use case: Crowded field imaging with aperture-fitting photometry
  • Data: JWST simulated NIRCam images from MIRAGE, run through the JWST calibration pipeline; LMC astrometric calibration field
  • Tools: jwst, photutils
  • Cross-instrument: potentially MIRI
Baseline
PSF Photometry
  • Use case: PSF photometry of crowded star field
  • Data: JWST simulated NIRCam images from MIRAGE, run through the JWST calibration pipeline; LMC astrometric calibration field
  • Tools: photutils, webbpsf
  • Cross-instrument:
Baseline
Extended Aperture PhotometryBaseline
PSF Matched Extended Aperture Photometry
  • Use case: Similar to multi-band extended aperture photometry (above), but PSF-matching is used to correct photometry measured in the Long Wavelength images (redder than F200W).
  • Data: JWST simulated NIRCam images from JADES JWST GTO extragalactic blank field.
  • Tools: photutils, webbpsf
  • Cross-instrument:
Baseline
NIRISS
Baseline
WFSS Single Object Galaxy Extraction and Analysis
  • Use case: optimal extraction of grism spectra; redshift measurement; emission-line maps
  • Data: JWST simulated NIRISS data from MIRAGE, run through the JWST calibration pipeline; galaxy cluster
  • Tools: Specutils
  • Cross-instrument: NIRSpec
Baseline
WFSS Multi-Object Spectroscopy
  • Use case: emission-line measurements and template matching on 1D spectra
  • Data: LEGA-C spectra and galaxy template spectra; optical rest-frame
  • Tools: Specutils
  • Cross-instrument: NIRSpec
Baseline
SOSS Transiting Exoplanet
  • Use case: primary transit of an exoplanet
  • Data: JWST simulated SOSS data from AWESIMSOSS simulator
  • Tools: jwst, Juliet
  • Cross-instrument:
Baseline
NIRISS AMI Binary Star
  • Use case: Find the binary parameters of AB Dor
  • Data: MIRAGE simulations for a binary point source AB Dor and calibrator HD37093 using the Aperture Masking Interferometry (AMI) mode on JWST NIRISS
  • Tools: jwst, nrm_analysis
  • Cross-instrument:
Baseline
NIRSpec
Baseline
IFU Analysis (Continuum Fitting)
  • Use case: continuum and emission-line modeling of AGN; 1.47–1.87 μm
  • Data: NIFS on Gemini; NGC 4151
  • Tools: Specutils, Cubeviz, Specviz
  • Cross-instrument: potentially MIRI
Advanced
IFU Cube Modeling
  • Use case: Extracting spatial-spectral features of interest from the cube of data and measuring their attributes. Create line and PAH maps from the model parameters map
  • Data: Spitzer IRS on Messier 58
  • Tools: Specutils, custom functions
  • Cross-instrument: MIRI, NIRSpec
Baseline
MOS Optimal Extraction
  • Use case: optimal spectral extraction, method by Horne (1986)
  • Data: JWST simulated NIRSpec MOS data; point sources
  • Tools: jwst, custom functions
  • Cross-instrument: any spectrograph
Baseline
MOS Pre-Imaging w/ NIRCam
  • Use case: Simulation of NIRCam imaging that can be used for NIRSpec MOS
  • Data: JWST simulated NIRCam data from MIRAGE; LMC
  • Tools: MIRAGE, jwst
  • Cross-instrument: NIRCam.
Baseline
BOTS Transiting Exoplanet
  • Use case: bright object time series; extracting exoplanet spectra
  • Data: JWST simulated NIRSpec data from ground-based campaign; GJ436b spectra from the Goyal et al. (2018)
  • Tools:
  • Cross-instrument:
Baseline
IFU Optimal Extraction
  • Use case: optimal spectral extraction; method by Horne (1986)
  • Data: faint (quasar) point source was simulated using the NIRSpec Instrument Performance Simulator (IPS), then run through the JWST Spec2 pipeline
  • Tools: jwst, Scipy, Specutils, Jdaviz, photutils, astropy.io, stropy.wcs, stropy.stats, astropy.utils, regions
  • Cross-instrument:
Baseline
MIRI
Baseline
LRS Optimal Extraction
  • Use case: extract spectra with different locations, extraction apertures, and techniques
  • Data: JWST simulated MIRI data
  • Tools: jwst, Specutils, Specviz, specreduce, gwcs
  • Cross-instrument: any spectrograph
Baseline
MRS IFU Cube Analysis 1
  • Use case: Run the jwst pipeline on MIRI MRS data
  • Data: JWST simulated MIRI MRS spectrum of AGB star.
  • Tools: Specutils, Specviz, photutils
  • Cross-instrument: any IFU
Advanced
MRS IFU Cube Analysis 2
  • Use case: Optimal extraction of a MIRI MRS spectrum using a detector based extraction algorithm
  • Data: JWST simulated MIRI MRS spectrum of AGB star.
  • Tools: Specutils, Specviz, photutils
  • Cross-instrument: any IFU
Advance
MRS IFU Cube Analysis 3
  • Use case: Extract spatial-spectral features from IFU cube and measure their attributes
  • Data: JWST simulated MIRI MRS spectrum of AGB star.
  • Tools: Specutils, Specviz, photutils
  • Cross-instrument: any IFU
Advanced
IFUs of YSOs in LMC
  • Use case: Detect point sources and extract photometry in a 3D cube. Analyze spectral lines.
  • Data:  ALMA 13CO data cubes.
  • Tools: Specutils, Photutils, custom functions
  • Cross-instrument: MIRI, NIRSpec
Baseline



References

Goyal, J.M., et al. 2018, MNRAS, 474, 4, 5158
A library of ATMO forward model transmission spectra for hot Jupiter exoplanets

Horne, K. 1986, PASP, 98, 609H
An optimal extraction algorithm for CCD spectroscopy




Latest updates

 
Updates for ERO and commissioning data public release.

Originally published