sncosmo.TimeSeriesSource

class sncosmo.TimeSeriesSource(phase, wave, flux, zero_before=False, name=None, version=None)[source]

A single-component spectral time series model.

The spectral flux density of this model is given by

\[F(t, \lambda) = A \times M(t, \lambda)\]

where _M_ is the flux defined on a grid in phase and wavelength and _A_ (amplitude) is the single free parameter of the model. The amplitude _A_ is a simple unitless scaling factor applied to whatever flux values are used to initialize the TimeSeriesSource. Therefore, the _A_ parameter has no intrinsic meaning. It can only be interpreted in conjunction with the model values. Thus, it is meaningless to compare the _A_ parameter between two different TimeSeriesSource instances with different model data.

Parameters
phasendarray

Phases in days.

wavendarray

Wavelengths in Angstroms.

fluxndarray

Model spectral flux density in erg / s / cm^2 / Angstrom. Must have shape (num_phases, num_wave).

zero_beforebool, optional

If True, flux at phases before minimum phase will be zeroed. The default is False, in which case the flux at such phases will be equal to the flux at the minimum phase (flux[0, :] in the input array).

namestr, optional

Name of the model. Default is None.

versionstr, optional

Version of the model. Default is None.

__init__(phase, wave, flux, zero_before=False, name=None, version=None)[source]

Methods

__init__(phase, wave, flux[, zero_before, …])

bandflux(band, phase[, zp, zpsys])

Flux through the given bandpass(es) at the given phase(s).

bandmag(band, magsys, phase)

Magnitude at the given phase(s) through the given bandpass(es), and for the given magnitude system(s).

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