Spectrum#

class uvex_transients.models.core.base.Spectrum(**overrides: Parameter | Quantity | float | int)[source]#

Abstract base class for frequency-dependent spectral shape models.

A Spectrum describes how a source’s light is distributed across frequency, as a shape \(S(\nu)\). It shares SpectralModel’s parameter storage, evaluation-family conventions, and sampling machinery, but – having no notion of time, redshift, or distance – carries none of SpectralModel’s \(t\)-dependent or observed-frame machinery (bolometric luminosity, flux, band flux, magnitudes).

To define a new model, subclass Spectrum and implement _eval(), the natural log of \(S(\nu)\) in cgs units. Unlike SpectralModel’s spectral shape, \(S(\nu)\) need not integrate to any particular value by construction – eval_normalization() computes whatever \(\int S(\nu)\,d\nu\) actually is, which is exactly the factor ComposedSpectralModel divides out to combine a Spectrum with a Lightcurve’s \(L_\mathrm{bol}(t)\) into an exactly normalized \(L_\nu(\nu, t)\).

See also

Lightcurve

The time-only counterpart this mirrors.

ComposedSpectralModel

Combines a Lightcurve and a Spectrum into a full SED.

Methods

eval(nu, **parameters)

Evaluate the spectral shape at the given frequency.

eval_cgs(nu, **parameters)

Spectral shape, taking and returning plain cgs numbers.

eval_from_arrays(nu, *parameters)

Positional-argument form of eval().

eval_log(nu, **parameters)

Natural log of the spectral shape, given physical-unit inputs.

eval_log_cgs(nu, **parameters)

Natural log of the spectral shape, taking and returning plain cgs numbers.

eval_normalization(**parameters)

Evaluate \(\int S(\nu)\,d\nu\).

eval_normalization_cgs(**parameters)

Return the shape's frequency integral as plain cgs numbers; see eval_normalization_log_cgs().

eval_normalization_log(**parameters)

Natural log of the shape's frequency integral, given physical-unit inputs.

eval_normalization_log_cgs(**parameters)

Natural log of the shape's frequency integral, taking and returning plain cgs numbers.

get(k[,d])

items()

keys()

pack_params_to_arrays(**parameters)

Convert a dict of parameter values into an ordered sequence.

sample_parameters([size, rng, parameters])

Draw random samples of some or all of this model's parameters.

simulate(nu[, size, rng])

Draw random parameter realizations and evaluate the model at the given frequency.

unpack_params_from_arrays(*parameters)

Convert an ordered sequence of parameter values back into a dict.

values()