# sncosmo.SALT2Source¶

class sncosmo.SALT2Source(modeldir=None, m0file='salt2_template_0.dat', m1file='salt2_template_1.dat', clfile='salt2_color_correction.dat', cdfile='salt2_color_dispersion.dat', errscalefile='salt2_lc_dispersion_scaling.dat', lcrv00file='salt2_lc_relative_variance_0.dat', lcrv11file='salt2_lc_relative_variance_1.dat', lcrv01file='salt2_lc_relative_covariance_01.dat', name=None, version=None)[source]

The SALT2 Type Ia supernova spectral timeseries model.

The spectral flux density of this model is given by

$F(t, \lambda) = x_0 (M_0(t, \lambda) + x_1 M_1(t, \lambda)) \times 10^{-0.4 CL(\lambda) c}$

where x0, x1 and c are the free parameters of the model, M_0, M_1 are the zeroth and first components of the model, and CL is the colorlaw, which gives the extinction in magnitudes for c=1.

Parameters
modeldirstr, optional

Directory path containing model component files. Default is None, which means that no directory is prepended to filenames when determining their path.

m0file, m1file, clfilestr or fileobj, optional

Filenames of various model components. Defaults are:

• m0file = ‘salt2_template_0.dat’ (2-d grid)

• m1file = ‘salt2_template_1.dat’ (2-d grid)

• clfile = ‘salt2_color_correction.dat’

errscalefile, lcrv00file, lcrv11file, lcrv01file, cdfilestr or fileobj

(optional) Filenames of various model components for model covariance in synthetic photometry. See bandflux_rcov for details. Defaults are:

• errscalefile = ‘salt2_lc_dispersion_scaling.dat’ (2-d grid)

• lcrv00file = ‘salt2_lc_relative_variance_0.dat’ (2-d grid)

• lcrv11file = ‘salt2_lc_relative_variance_1.dat’ (2-d grid)

• lcrv01file = ‘salt2_lc_relative_covariance_01.dat’ (2-d grid)

• cdfile = ‘salt2_color_dispersion.dat’ (1-d grid)

Notes

The “2-d grid” files have the format <phase> <wavelength> <value> on each line.

The phase and wavelength values of the various components don’t necessarily need to match. (In the most recent salt2 model data, they do not all match.) The phase and wavelength values of the first model component (in m0file) are taken as the “native” sampling of the model, even though these values might require interpolation of the other model components.

__init__(modeldir=None, m0file='salt2_template_0.dat', m1file='salt2_template_1.dat', clfile='salt2_color_correction.dat', cdfile='salt2_color_dispersion.dat', errscalefile='salt2_lc_dispersion_scaling.dat', lcrv00file='salt2_lc_relative_variance_0.dat', lcrv11file='salt2_lc_relative_variance_1.dat', lcrv01file='salt2_lc_relative_covariance_01.dat', name=None, version=None)[source]

Methods

 __init__([modeldir, m0file, m1file, clfile, ...]) bandflux(band, phase[, zp, zpsys]) Flux through the given bandpass(es) at the given phase(s). bandflux_rcov(band, phase) Return the relative model covariance (or "model error") on synthetic photometry generated from the model in the given restframe band(s). bandmag(band, magsys, phase) Magnitude at the given phase(s) through the given bandpass(es), and for the given magnitude system(s). colorlaw([wave]) Return the value of the CL function for the given wavelengths. flux(phase, wave) The spectral flux density at the given phase and wavelength values. get(name) Get parameter of the model by name. maxphase() maxwave() minphase() minwave() peakmag(band, magsys[, sampling]) Peak apparent magnitude in rest-frame bandpass. peakphase(band_or_wave[, sampling]) Determine phase of maximum flux for the given band/wavelength. set(**param_dict) Set parameters of the model by name. set_peakmag(m, band, magsys[, sampling]) Set peak apparent magnitude in rest-frame bandpass. update(param_dict) Set parameters of the model from a dictionary.

Attributes

 param_names List of parameter names. param_names_latex parameters Parameter value array