Example Jupyter Notebooks -- Data Analysis Tools

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

See Also: Notebooks Landing Page, Notebooks GitHub Page

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

The notebooks utilize Astropy machinery, including the Jdaviz visualization tools; they're likely to be useful for analyzing data from other observatories as well. These notebooks can be downloaded and executed by cloning the GitHub repository to your local computer.  Most of the notebooks rely on packages that are available in Astroconda, although a few rely on packages that should be installed using pip. The version dependencies are listed in the environment.yaml and in the requirements file in each notebook folder.  You can also just view rendered versions of the notebooks.

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.


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
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
MultiBand Aperture Photometry
  • Use case: measure galaxy photometry in a field. Related to JDox science use case #22
  • Data: JWST simulated NIRCam images from JADES JWST GTO extragalactic blank field
  • Tools: photutils
  • Cross-instrument: potentially MIRI
Baseline
Crowded Field 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
PSF (Matched) 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. In this case, the PSF-matching is used to correct photometry measured in the long wavelength images (redder than F200W)
  • Tools: photutils, webbpsf
  • Cross-instrument:
Baseline
NIRISS
Baseline
WFSS 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
MOS 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
  • Cross-instrument: potentially MIRI
Advanced
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 pre-imaging for NIRSpec
  • 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
IFU Cube Fitting
  • Use case: continuum and emission-line modeling of galaxy IFU spectra; PAH wavelength region
  • Data: Spitzer IRS on Messier 58
  • Tools: Specutils, custom functions
  • Cross-instrument: NIRSpec
Baseline
LRS Optimal Extraction
  • Use case: extract spectra with different locations, extraction apertures, and techniques
  • Data: JWST simulated MIRI data
  • Tools: jwst, gwcs
  • Cross-instrument: any spectrograph
Baseline
MRS IFU Cube Analysis 1
  • Use case: extract spatial-spectral features from IFU cube and measure their attributes
  • Data: KMOS datacube of point sources in the LMC
  • Tools: Specutils, spectral_cube, photutils
  • Cross-instrument: any IFU
Baseline
MRS IFU Cube Analysis 2
  • Use case: use photutils to automatically detect point sources and extract photometry in a given 3D cube, then use specutils to find the important lines to first identify and analyze spectral lines
  • Data: ALMA 13CO data cubes
  • Tools: Specutils, spectral_cube, photutils
  • Cross-instrument: any IFU
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


Originally published