#!/usr/bin/env python import numpy as np import pylab as py from cosmology import Cosmology phaseSN = raw_input("phase? ") phaseSN = int(phaseSN) + 21 redshift = raw_input("z? ") redshift = float(redshift) # Read in template #file='JHK_template.txt' file = 'sn1a_lc.v1.2.dat' #(phase, jmag, jmagerr, hmag, hmagerr, kmag, kmagerr) = np.loadtxt(file, unpack=True) (phase, Umag, Bmag, Vmag, Rmag, Imag, jmag, hmag, kmag) = np.loadtxt(file, unpack=True) # Magnitude of a Type Ia SNeIa # Wood-Vasey08 (disagrees a bit with Krisciunas05) absmagV=-18.29 - 0.56 absmagJ=-18.29 absmagH=-18.08 absmagK=-18.32 #absmagV = -19.504 #JRK07 c = Cosmology() mu = c.DistMod(redshift) print 'B V R I J H Ks' print '%2.2f %2.2f %2.2f %2.2f %2.2f %2.2f %2.2f' %(Bmag[phaseSN] + absmagV + mu, Vmag[phaseSN] + absmagV + mu, Rmag[phaseSN] + absmagV + mu, Imag[phaseSN] + absmagV + mu, jmag[phaseSN] + absmagV + mu, hmag[phaseSN] + absmagV + mu, kmag[phaseSN] + absmagV + mu)