SpectralModel#

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

Abstract base class for time-dependent spectral energy distribution models.

A SpectralModel represents the intrinsic spectral luminosity

\[L_\nu(\nu, t),\]

as a function of source-frame frequency \(\nu\) and time since explosion \(t\). From this fundamental quantity, the base class provides a consistent interface for computing bolometric luminosities, normalized spectral shapes, observed flux densities, band-averaged fluxes, apparent magnitudes, and synthetic SourceSpectrum objects.

Notes

The core subclassing interface consists of:

  • _DEFAULT_PARAMETERS for declaring model parameters;

  • _DOMAIN for the frequency range used by the default bolometric integration; and

  • _eval() for evaluating \(\log L_\nu(\nu, t)\) in unit-stripped cgs coordinates.

Every other public method – including as_astropy_model() and as_source_spectrum(), which build synthetic spectra – is derived automatically from _eval() and requires no per-subclass override.

Most user-facing quantities are available in parallel interfaces:

*_log_cgs

Unit-stripped cgs inputs and logarithmic numerical output.

*_log

Physical-unit inputs and logarithmic numerical output.

*_cgs

Unit-stripped cgs inputs and linear numerical output.

no suffix

Physical-unit inputs and physical-unit output.

Because magnitudes are already logarithmic quantities, their API consists only of unit-stripped *_cgs and unit-aware forms.

All of the above are classmethods: they operate purely on the **parameters values passed in, not on any particular instance’s stored parameter configuration. Only parameter storage – inherited from _ModelBase – requires an instance.

Methods

as_astropy_model([x_type, y_type, y_kind, ...])

Build an Model of this SpectralModel for a given parameter set.

as_source_spectrum(t, *[, redshift, ...])

Build a SourceSpectrum giving the observed flux at one fixed time \(t\).

eval(nu, t, **parameters)

Evaluate the spectral luminosity at the given frequency and time.

eval_bolometric(t, **parameters)

Evaluate the bolometric luminosity at the given time.

eval_bolometric_cgs(t, **parameters)

Bolometric luminosity, taking and returning plain cgs numbers.

eval_bolometric_log(t, **parameters)

Natural log of the bolometric luminosity, given physical-unit inputs.

eval_bolometric_log_cgs(t, **parameters)

Natural log of the bolometric luminosity, taking and returning plain cgs numbers.

eval_cgs(nu, t, **parameters)

Spectral luminosity, taking and returning plain cgs numbers.

eval_from_arrays(nu, t, *parameters)

Positional-argument form of eval().

eval_log(nu, t, **parameters)

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

eval_log_cgs(nu, t, **parameters)

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

eval_spectrum(nu, t, **parameters)

Evaluate the normalized spectral shape at the given frequency and time.

eval_spectrum_cgs(nu, t, **parameters)

Return the normalized spectral shape as plain cgs numbers; see eval_log_cgs().

eval_spectrum_log(nu, t, **parameters)

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

eval_spectrum_log_cgs(nu, t, **parameters)

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

flux(nu, t, *[, redshift, ...])

Evaluate the observed flux density at the given frequency and time.

flux_band(nu, throughput, t, *[, redshift, ...])

Evaluate the throughput-weighted mean observed flux density over a band.

flux_band_cgs(nu, throughput, t, redshift, ...)

Band-averaged observed flux density as plain cgs numbers; see flux_band_log_cgs().

flux_band_log(nu, throughput, t, *[, ...])

Natural log of the band-averaged observed flux density, given physical-unit inputs.

flux_band_log_cgs(nu, throughput, t, ...[, ...])

Natural log of the throughput-weighted mean flux density over a band, plain cgs numbers.

flux_bolometric(t, *[, redshift, ...])

Evaluate the observed bolometric flux at the given time.

flux_bolometric_cgs(t, redshift, ...)

Observed bolometric flux, taking and returning plain cgs numbers.

flux_bolometric_log(t, *[, redshift, ...])

Natural log of the observed bolometric flux, given physical-unit inputs.

flux_bolometric_log_cgs(t, redshift, ...)

Natural log of the observed bolometric flux, taking and returning plain cgs numbers.

flux_cgs(nu, t, redshift, luminosity_distance, *)

Observed flux density, taking and returning plain cgs numbers.

flux_log(nu, t, *[, redshift, ...])

Natural log of the observed flux density, given physical-unit inputs.

flux_log_cgs(nu, t, redshift, ...[, ...])

Natural log of the observed flux density, taking and returning plain cgs numbers.

get(k[,d])

items()

keys()

mag(nu, t, *[, redshift, ...])

Evaluate the apparent AB magnitude at the given frequency and time.

mag_band(nu, throughput, t, *[, redshift, ...])

Evaluate the apparent AB magnitude of the band-averaged flux density.

mag_band_cgs(nu, throughput, t, redshift, ...)

Apparent AB magnitude of the band-averaged flux density.

mag_bandpass(bandpass, t, *[, redshift, ...])

Evaluate the apparent AB magnitude of the flux averaged over bandpass.

mag_cgs(nu, t, redshift, luminosity_distance, *)

Apparent AB magnitude: \(m_\mathrm{AB} = -2.5 \log_{10}(F_\nu / F_{\mathrm{AB},0})\).

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, t[, size, rng])

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

simulate_photometry(t, exptime, detector, ...)

Simulate noisy synthetic photometry of this model at given time(s), against a real detector.

unpack_params_from_arrays(*parameters)

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

values()