File: subsample_hsiao_model.py

package info (click to toggle)
sncosmo 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,628 kB
  • sloc: python: 7,278; cpp: 184; makefile: 130; sh: 1
file content (16 lines) | stat: -rwxr-xr-x 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
"""
Usage: %prog INFILE OUTFILE

Subsample the Hsiao spectral time series, for use as a small demonstration
model that can be included with source code."""

from optparse import OptionParser
from sncosmo.io import read_griddata_fits, write_griddata_fits

parser = OptionParser()
options, args = parser.parse_args()

phase, wave, flux = read_griddata_fits(args[0])
write_griddata_fits(phase[::5], wave[::5], flux[::5, ::5], args[1])
print "wrote to", args[1]