sncosmo.read_snana_fits

sncosmo.read_snana_fits(head_file, phot_file, snids=None, n=None)[source]

Read the SNANA FITS format: two FITS files jointly representing metadata and photometry for a set of SNe.

Parameters
head_filestr

Filename of “HEAD” (“header”) FITS file.

phot_filestr

Filename of “PHOT” (“photometry”) FITS file.

snidslist of str, optional

If given, only return the single entry with the matching SNIDs.

nint

If given, only return the first n entries.

Returns
snelist of Table

Each item in the list is an astropy Table instance.

Notes

If head_file contains a column ‘SNID’ containing strings, leading and trailing whitespace is stripped from all the values in that column.

If phot_file contains a column ‘FLT’, leading and trailing whitespace is stripped from all the values in that column.

Examples

>>> sne = read_snana_fits('HEAD.fits', 'PHOT.fits')
>>> for sn in sne:
...     sn.meta  # Metadata in an OrderedDict.
...     sn['MJD']  # MJD column