Astrolib PySynphot (pysynphot)

Note

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

Introduction

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), https://pysynphot.readthedocs.io/en/latest/”. Alternately, bibcode is available from Astrophysics Source Code Library.

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

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:

Description

Directory name

Download

Master tables

$PYSYN_CDBS/mtab/

http://ssb.stsci.edu/trds/tarfiles/synphot1.tar.gz

HST/ACS throughput tables

$PYSYN_CDBS/comp/acs/

HST/COS throughput tables

$PYSYN_CDBS/comp/cos/

HST/FGS throughput tables

$PYSYN_CDBS/comp/fgs/

HST/FOC throughput tables

$PYSYN_CDBS/comp/foc/

HST/FOS throughput tables

$PYSYN_CDBS/comp/fos/

HST/HRS throughput tables

$PYSYN_CDBS/comp/hrs/

HST/HSP throughput tables

$PYSYN_CDBS/comp/hsp/

HST/NICMOS throughput tables

$PYSYN_CDBS/comp/nicmos/

HST/OTA throughput tables

$PYSYN_CDBS/comp/ota/

HST/STIS throughput tables

$PYSYN_CDBS/comp/stis/

HST/WFC3 throughput tables

$PYSYN_CDBS/comp/wfc3/

HST/WFPC1 throughput tables

$PYSYN_CDBS/comp/wfpc/

HST/WFPC2 throughput tables

$PYSYN_CDBS/comp/wfpc2/

Non-HST throughput tables

$PYSYN_CDBS/comp/nonhst/

These data files are needed for calculations involving source spectra:

Description

Directory name

Download

Interstellar extinction curves

$PYSYN_CDBS/extinction/

http://ssb.stsci.edu/trds/tarfiles/synphot2.tar.gz

AGN templates

$PYSYN_CDBS/grid/agn/

Bruzual-Charlot galaxy spectra

$PYSYN_CDBS/grid/bc95/

Buser-Kurucz stellar atlas

$PYSYN_CDBS/grid/bkmodels/

Bruzual-Persson-Gunn-Stryker stellar atlas

$PYSYN_CDBS/grid/bpgs/

Brown galaxy atlas

$PYSYN_CDBS/grid/brown/

Bruzual stellar atlas

$PYSYN_CDBS/grid/bz77/

Galactic emission line objects

$PYSYN_CDBS/grid/galactic/

Gunn-Stryker atlas

$PYSYN_CDBS/grid/gunnstryker

Jacobi-Hunter-Christian stellar atlas

$PYSYN_CDBS/grid/jacobi/

Kinney-Calzetti galaxy spectra

$PYSYN_CDBS/grid/kc96/

Pickles stellar atlas

$PYSYN_CDBS/grid/pickles/

Castelli & Kurucz (2004) stellar atlas

$PYSYN_CDBS/grid/ck04models/

http://ssb.stsci.edu/trds/tarfiles/synphot3.tar.gz

Kurucz (1993) stellar atlas

$PYSYN_CDBS/grid/k93models/

http://ssb.stsci.edu/trds/tarfiles/synphot4.tar.gz

Phoenix stellar atlas

$PYSYN_CDBS/grid/phoenix/

http://ssb.stsci.edu/trds/tarfiles/synphot5.tar.gz

HST calibration spectra

$PYSYN_CDBS/calspec/

http://ssb.stsci.edu/trds/tarfiles/synphot6.tar.gz

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']
'/my/local/dir/trds/'
>>> 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

References

  • 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