No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

jwst_backgrounds is a a simple program to predict the levels of background emission in JWST observations, for use in proposal planning.

It accesses a precompiled background cache prepared by Space Telescope Science Institute. The background cache is hosted by the Mikulski Archive for Space Telescopes (MAST), so you need internet access to run the tool with the remote cache. It is possible to download the full background cache to your local machine. Instructions for downloading the background cache can be found at

For a given target (RA, DEC), and wavelength, jwst_backgrounds does the following:

  • Plot the spectrum of the background for that target on a given calendar day.
  • Plot the total background for that target versus calendar day.
  • Compute the number of days per year that the target is observable at low background, for a given wavelength and a selectable threshold.
  • Save the retrieved background data to file.

This code was written by Jane Rigby (GSFC, and Klaus Pontoppidan (STScI, The background cache was prepared by Wayne Kinzel at STScI, and is the same as used by the JWST Exposure Time Calculator.

This software is provided as-is, with no warranty.


Using pip:

pip install jwst_backgrounds

Note: healpy (version >= 1.10) is a required dependency, so if you don't have it pip will install it automatically.


  1. Install healpy with pip install --user healpy
  2. Download jwst_backgrounds from
  3. Install jwst_backgrounds with "python install"

Note that some people have had trouble installing healpy with pip. An alternate way to get healpy is using conda:

conda config --add channels conda-forge
conda install healpy
pip install jwst_backgrounds


python			# Start python.
from jwst_backgrounds import jbt 	# Import the background module

Below is an example that plots a background curve for a given RA, DEC, wavelength, threshold

jbt.get_background(261.6833333, -73.33222222, 2.15, thresh=1.1, \
                        plot_background=True, plot_bathtub=True, write_bathtub=True) 


If matplotlib does not display the images, then try editing your ~/.matplotlib/matplotlibrc file, and choosing a different backend:

backend: MacOSX
backend: TkAgg
backend: GTKCairo