[AstroPy] pysynphot

Thomas Vaughan tevaughan at gmail.com
Mon Jun 13 12:22:14 EDT 2011


On Tue, May 17, 2011 at 18:22, Vicki Laidler <laidler at stsci.edu> wrote:
>
> Indeed, astrolib includes pysynphot, which is presently being used
> under the hood of the HST Exposure Time Calculators. It's intended as
> a replacement for the IRAF STSDAS synphot package, and is largely
> complete. I'm the primary developer for pysynphot at this time.

Thanks for responding to my query last month. Pysynphot looks like the
right tool to me. I'm just now getting round to looking at the
software, and I have a couple of questions.

> You would need to create a throughput file (wavelength and throughput in dimensionless units between 0 and 1) for each band in your instrument, and a spectrum file or array (wavelength and flux) or black body as a function of temperature.

My plan is (rather than to use blackbody spectra) to use the
flux-calibrated template library of Pickles (1998) and match these up
to the spectral identifications in the Tycho-2 Spectral Type Catalog.

> Once you have those, you can simulate an observation and predict the
> magnitude, something like this:
>
> import pysynphot as psyn
> bp = psyn.FileBandpass('your_throughput_file.fits')
> sp = psyn.FileSpectrum('spectrum_file.fits')
> obs = psyn.Observation(sp, bp)
> obs.effstim('abmag')  #gives you the observed magnitude

That looks nice and easy. I don't have stuff in FITS format, but I
suppose that your library can read a text file with a couple of
columns.

One issue that I've had right up front is in installing pysynphot-0.7.
 I looked at the README file, and installed the listed prerequisites.
Nevertheless, on attempted installation I got an error message about a
missing library that seemed to be named as if it were part of the
stsci_python package.

So I grabbed stsci-python-2.11.  That seems to have installed well
enough.  It came with a pysynphot.  A recursive diff shows that
pysynphot-0.7 is different from the pysynphot in stsci-python-2.11.
Which is better to use?

-- 
Thomas E. Vaughan



More information about the AstroPy mailing list