Table Of Contents

Next topic

pysynphot.Cache

This Page

Welcome to PySynphot’s documentation!

Package:
 Astrolib Pysynphot

Purpose

Object-oriented replacement for STSDAS synphot package.

This __init__ file is used to expose the desired elements of the user interface for interactive use.

Dependencies

  • numpy 1.5.1 or greater
  • pyfits 2.4 or greater

Environment

The environment variable PYSYN_CDBS must be set.

Example

In the examples below, items which may be installation- or platform- specific are commented out so as to be excluded from doctest. However users are still encouraged to try these examples.

A quickstart tutorial containing further examples and other documentation can be found at U{http://stsdas.stsci.edu/pysynphot/

>>> import pysynphot as S
>>> import os
>>> print S.__version__
0.9.4dev
>>> #Read a spectrum from a file
>>> vega=S.FileSpectrum(S.locations.VegaFile)
>>> bb=S.BlackBody(40000)
>>> print bb
BB(T=40000)
>>> pl=S.PowerLaw(10000,-2)
>>> print pl
Power law: refwave 10000 angstrom, index -2
>>> g1=S.GaussianSource(18.3,18000,2000,fluxunits='abmag')
>>> print g1
Gaussian: mu=18000 angstrom,fwhm=2000 angstrom, total flux=18.3 abmag
>>> unitflux=S.FlatSpectrum(18,fluxunits='abmag')
>>> print unitflux
Flat spectrum of 18 abmag
>>> bp1=S.ObsBandpass('acs,hrc,f555w')
>>> print bp1
acs,hrc,f555w
>>> print bp1.wave
[   500.   1000.   1010. ...,  11999.  30000.  30010.]
>>> print bp1.throughput
[ 0.  0.  0. ...,  0.  0.  0.]
>>> len(bp1)
6
>>> print bp1.waveunits
angstrom
>>> obs1=S.Observation(vega,bp1)
>>> print obs1.waveunits
angstrom
>>> print obs1.fluxunits
flam

Indices and tables