Astrolib PySynphot (pysynphot)


This package is no longer actively developed. See package roadmap for more information.


Astrolib PySynphot (hereafter referred to only as pysynphot) is an object-oriented replacement for STSDAS SYNPHOT synthetic photometry package in IRAF. It is distributed as part of AstroConda (preferred) and also as standalone. Although this package was developed for HST, it can be utilized with other observatories.

pysynphot simulates photometric data and spectra as they are observed with the Hubble Space Telescope (HST). Passbands for standard photometric systems are available, and users can incorporate their own filters, spectra, and data. pysynphot user interface allows you to:

  • Construct complicated composite spectra from various grids of model atmosphere spectra, parameterized spectrum models, and atlases of stellar spectrophotometry.

  • Simulate observations.

  • Query the resulting structures for quantities of interest, such as countrate, effective wavelength, effective stimulus, as well as the wavelength and flux arrays.

  • Plot HST sensitivity curves and calibration target spectra.

  • Compute photometric calibration parameters for any HST instrument mode.

pysynphot can help HST observers to perform cross-instrument simulations, to examine the transmission curve of the HST Optical Telescope Assembly (OTA), and spectra of HST calibration targets. Expert users can take advantage of the control and data structures available in Python to easily perform repetitive operations such as simulate the observation of multiple type of sources through multiple observing modes.

If you use pysynphot in your work, please cite it as, “Lim, P. L., Diaz, R. I., & Laidler, V. 2015, PySynphot User’s Guide (Baltimore, MD: STScI),”. Alternately, bibcode is available from Astrophysics Source Code Library.

If you have questions or concerns regarding the software, please contact STScI Help Desk via

Installation and Setup

If you have AstroConda, simply install with this command:

conda install pysynphot

To install the PyPI release:

pip install pysynphot

If missing, the following dependencies must also be installed:

Data files for pysynphot are distributed separately by Calibration Reference Data System. They are expected to follow a certain directory structure under the root directory, identified by the PYSYN_CDBS environment variable that must be set prior to using this package. In the example below, the root directory is arbitrarily named /my/local/dir/trds/.

In bash shell:

export PYSYN_CDBS=/my/local/dir/trds/

In csh shell:

setenv PYSYN_CDBS /my/local/dir/trds/

These data files are needed for calculations involving HST bandpasses:


Directory name


Master tables


HST/ACS throughput tables


HST/COS throughput tables


HST/FGS throughput tables


HST/FOC throughput tables


HST/FOS throughput tables


HST/HRS throughput tables


HST/HSP throughput tables


HST/NICMOS throughput tables


HST/OTA throughput tables


HST/STIS throughput tables


HST/WFC3 throughput tables


HST/WFPC1 throughput tables


HST/WFPC2 throughput tables


Non-HST throughput tables


These data files are needed for calculations involving source spectra:


Directory name


Interstellar extinction curves


AGN templates


Bruzual-Charlot galaxy spectra


Buser-Kurucz stellar atlas


Bruzual-Persson-Gunn-Stryker stellar atlas


Brown galaxy atlas


Bruzual stellar atlas


Galactic emission line objects


Gunn-Stryker atlas


Jacobi-Hunter-Christian stellar atlas


Kinney-Calzetti galaxy spectra


Pickles stellar atlas


Castelli & Kurucz (2004) stellar atlas


Kurucz (1993) stellar atlas


Phoenix stellar atlas


HST calibration spectra


Throughout this document, unless explicitly stated otherwise, the examples assume that PYSYN_CDBS points to the correct location, and that the relevant packages are already imported:

>>> import os
>>> os.environ['PYSYN_CDBS']
>>> import numpy as np
>>> import pysynphot as S

For plotting, make sure you have the optional matplotlib package and turn on its interactive mode:

>>> import matplotlib.pyplot as plt
>>> plt.ion()

Before drawing a new plot, you must clear the existing plot:

>>> plt.clf()

Using pysynphot


  • Bessell, M. S. 1983, PASP, 95, 480

  • Bessell, M. S. & Brett, J. M. 1988, PASP, 100, 1134

  • Bohlin, R. C., Dickinson, M. E., & Calzetti, D. 2001, AJ, 122, 2118

  • Bohlin, R. C. & Gilliland, R. L. 2004, AJ, 127, 3508

  • Brown, M. J. I., et al. 2014, ApJS, 212, 18

  • Calzetti, D., Armus, L., Bohlin, R. C., Kinney, A. L., Koornneef, J., & Storchi-Bergmann, T. 2000, ApJ, 533, 682

  • Calzetti, D., Kinney, A. L., & Storchi-Bergmann, T. 1994, ApJ, 429, 582

  • Cardelli, J. A., Clayton, G. C., & Mathis, J. S. 1989, ApJ, 345, 245

  • Francis, P. J., Hewett, P. C., Foltz, C. B., Chaffee, F. H., Weymann, R. J., & Morris, S. L. 1991, ApJ, 373, 465

  • Fukugita, M., Ichikawa, T., Gunn, J. E., Doi, M., Shimasaku, K., & Schneider, D. P. 1996, AJ, 111, 1748

  • Gordon, K. D., Clayton, G. C., Misselt, K. A., Landolt, A. U., & Wolff, M. J. 2003, ApJ, 594, 279

  • Gunn, J. E. & Stryker, L. L. 1983, ApJS, 52, 121

  • Harris, H., Baum, W., Hunter, D., & Kreidl, T. 1991, AJ, 101, 677

  • Holberg, J. B. & Bergeron, P. 2006, AJ, 132, 1221

  • Howarth, I. D. 1983, MNRAS, 203, 301

  • Jacoby, G. H., Hunter, D. A., & Christian, C. A. 1984, ApJS, 56, 257

  • Johnson, H. L. 1965, ApJ, 141, 923

  • Kinney, A. L., Calzetti, D., Bohlin, R. C., McQuade, K., Storchi-Bergmann, T., & Schmitt, H. R. 1996, ApJ, 467, 38

  • Koornneef, J., Bohlin, R., Buser, R., Horne, K., & Turnshek, D. 1986, Highlights Astron., 7, 833

  • Landolt, A. U. 1983, AJ, 88, 439

  • Lub, J. & Pel, J. W. 1977, A&A, 54, 137

  • Lupton, R. H., Gunn, J. E., & Szalay A. S. 1999, AJ, 118, 1406

  • Morrissey, P. et al. 2007, ApJS, 173, 682

  • Oke, J. B., 1974, ApJS, 27, 21

  • Oke, J. B. & Gunn, J. E. 1983, ApJ, 266, 713

  • Pickles, A. J. 1998, PASP, 110, 863

  • Rybicki, G. B., & Lightman, A. P. 1979, Radiative Processes in Astrophysics (New York, NY: Wiley)

  • Savage, B. D. & Mathis, J. S. 1979, ARA&A, 17, 73

  • Schneider, D. P., Gunn, J. E., & Hoessel J. G. 1983, ApJ, 264, 337

  • Seaton, M. J. 1979, MNRAS, 187, 785

  • Smith, J. A. et al. 2002, AJ, 123, 2121

  • Strecker, D. W. et al. 1979, ApJS, 41, 501

  • van Duinen, R. J., Aalders, J. W. G., Wesselius, P. R., Wildeman, K. J., Wu, C. C., Luinge, W., & Snel, D. 1975, A&A, 39, 159