The objective of this notebook is to compare the filters provided by N. Karpenka to the bandpasses in sncosmo registry. This seems to match up pretty well.


In [5]:
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt

In [6]:
import os
import transientSources as ts
import sncosmo

In [3]:
example_data =  os.path.join(os.path.split(ts.__file__)[0], 'example_data')

In [4]:
filter_dir = os.path.join(example_data, 'filters')

In [7]:
def _comparefilters(fname, bandname):
    """
    
    Parameters
    ----------
    fname : filename inside filters directory for the ASCII files
     
    bandname : string corresponding to the band in sncosmo.registry
    """
    fname = os.path.join(filter_dir, fname)
    data = np.loadtxt(fname)
    bN = sncosmo.Bandpass(wave=data[:, 0], trans=data[:, 1])
    bS = sncosmo.get_bandpass(bandname)
    plt.plot(bS.wave, bS.trans)
    plt.plot(bN.wave, bN.trans, 'or')

In [8]:
_comparefilters('B.dat', 'bessellB')



In [9]:
_comparefilters('V.dat', 'bessellV')



In [12]:
_comparefilters('i.dat', 'besselli')



In [13]:
_comparefilters('r.dat', 'bessellr')



In [ ]:
fsum = np.sum(b.trans * b.dwave, axis=1)