ComposedSpectralModel#

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

A SpectralModel built by pairing a Lightcurve with a Spectrum.

\[L_\nu(\nu, t) = L_\mathrm{bol}(t) \cdot \frac{S(\nu)}{\int S(\nu')\,d\nu'}\]

where \(L_\mathrm{bol}(t)\) is _LIGHTCURVE_CLASS’s bolometric luminosity and the fraction is _SPECTRUM_CLASS’s shape, normalized (via Spectrum.eval_normalization()) to integrate to 1 over \(\nu\). Because both halves are already exact on their own, _eval_bolometric() and _eval_spectrum() are closed-form combinations of the two components’ own primitives – unlike SpectralModel’s generic defaults, neither ever falls back to numerical integration over frequency here.

A concrete SED is defined just by naming the two component classes:

class MySED(ComposedSpectralModel):
    _LIGHTCURVE_CLASS = FREDLightcurve
    _SPECTRUM_CLASS = BlackbodySpectrum

At class-definition time, __init_subclass__() merges _LIGHTCURVE_CLASS._DEFAULT_PARAMETERS and _SPECTRUM_CLASS._DEFAULT_PARAMETERS into this subclass’s own _DEFAULT_PARAMETERS (any entries the subclass declares directly itself win, as overrides on top of that merge) – so from then on, MySED behaves exactly like any other SpectralModel subclass: MySED() or MySED(amplitude=..., temperature=...), one flat parameter namespace. Every parameter name must be unique across the two component classes, checked at class-definition time.

Because every SpectralModel method is a classmethod operating purely on **parameters (see the module docstring), no instance-level wiring of components is needed: _eval_bolometric(), _eval_spectrum(), and _eval() simply split the incoming parameters dict by name and call _LIGHTCURVE_CLASS’s/ _SPECTRUM_CLASS’s own classmethods directly.

See also

Lightcurve

The time-only half of this composition.

Spectrum

The frequency-only half of this composition.

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()