Pandeia Order of Operations

How to use JWST Pandeia from Python, as well as a number of important considerations about how Pandeia runs, is covered in this article. 

From within Python, in order to import and start running a Pandeia calculation, simply enter the following on the command line, as long as a configuration dictionary exists:

Running Pandeia
from pandeia.engine.perform_calculation import perform_calculation
report = perform_calculation(configuration)

Running "perform_calculation(configuration, dict_report=False)" will generate output in the form of a Pandeia Report object rather than a dictionary.

Order of operations for Pandeia

It is important to consider the order in which Pandeia performs calculation tasks. The Pandeia order of operations for each source in the observation is as follows:

  1. Pandeia loads all of the sources listed in the "Scene."

  2. Then, it loads the "Instrument" configuration, as well as any instrument-specific parameters like PSFs, and computes the exposure time.

  3. Then, it configures the required "Strategy," as defined in the strategy section of the calculation.

  4. The instrument configuration, sky background configuration, "Scene," and "Strategy" are bundled together into an "Observation."

  5. The "Observation" is used to generate a "Model Scene Cube."

  6. For each source, the spectrum is processed:
    1. Create the source SED, using information in the "source['scene']['spectrum']" dictionary, except that redshift, extinction, and normalization are not yet applied.
    2. Apply the redshift defined in "source['scene']['spectrum']['redshift']"
    3. Apply the extinction defined in "source['scene']['spectrum']['extinction']"
    4. Apply the normalization defined in "source['scene']['spectrum']['normalization']"
    5. Update any warnings generated by creating the SED or applying normalization
    6. Add all emission lines specified in "source['scene']['spectrum']['lines']"

  7. For each source, the spatial information is processed.
    1. A properly-defined shape is created and positioned on a 2-D array.
    2. The 2-D array is multiplied by the spectrum to form a 3-D flux cube of the source at every wavelength
    3. The 3-D flux cube is convolved by the appropriate PSFs (for each wavelength) from the pre-generated PSF library.
    4. The background (if any is specified) is converted from MJy/sr/μm to mJy/pixel/μm and added to each slice of the 3-D flux cube (for the first source only).

  8. The 3-D flux cubes of all of the sources are added together to form a "Convolved Scene Cube."

  9. The convolved scene cube is projected onto a "detector" according to the observation type—imaging-like, spectroscopy, slitless spectroscopy, multiorder spectroscopy—and converted from mJy to e/s

  10. The detector flux and noise are passed to the "Strategy," which extracts flux, SNR, and most other reported parameters of interest.

  11. The "Report" class creates realistic 2-D images of the detector (and SNR) with appropriately randomized noise, and collects all the properties to be reported (in a Python dictionary, the web interface, or the downloads file)

Note that, as a result of the order of operations in step 6, extinction will not be applied to emission lines, nor will redshift. Whilst a zero-continuum source with only emission lines can be created, and any or all of redshift, extinction, or normalization can be applied to it, none of those parameters will actually change the emission lines as input. In addition, if you create a continuum source with emission (or absorption) lines in the normalization bandpass, these lines will not be present when the source is normalized, so the final source flux in that bandpass will differ from the normalization value you entered. If you wish to normalize or redshift a spectrum with lines, you will need to generate the spectrum with lines outside of the engine and input it:

Custom spectrum upload
source['scene']['spectrum']['sed']['sed_type'] = 'input'
source['scene']['spectrum']['sed']['spectrum'] = [<wavelength array>, <flux array>]

For more information on the inner workings of Pandeia, consult Pontoppidan et al. (2016).


Pontoppidan, K. M., Pickering, T. E.,  Laidler, V. G.  et al., 2016, Proc. SPIE 9910, Observatory Operations: Strategies, Processes, and Systems VI, 991016
Pandeia: a multi-mission exposure time calculator for JWST and WFIRST

Latest updates
    Reviewed for ETC v1.6

    Updated for ETC v1.5.

  • Added references section, added reference, and fixed link to reference in text.

  • Updated for ETC v1.3. Title changed. Some material moved to Pandeia Configuration Dictionaries article.
Originally published