uvex_transients.models.kilonovae.kne.KilonovaCoolingBlackbodySED.as_source_spectrum#

classmethod KilonovaCoolingBlackbodySED.as_source_spectrum(t: PhysicalInput, *, redshift: PhysicalInput | None = None, luminosity_distance: Quantity | None = None, angular_diameter_distance: Quantity | None = None, proper_distance: Quantity | None = None, cosmology: FLRW | None = None, ebv: float | Quantity | FloatArray | None = None, dust_law: str | None = None, **parameters: ParameterValue) → SourceSpectrum#

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

A thin wrapper around as_astropy_model(): fixes t (so the result is a function of wavelength alone, the shape synphot requires), and fixes x_type/y_type/y_kind to wavelength-in/photon-out, in Angstrom – because SourceSpectrum always samples its wrapped model in wavelength space, and always treats the model’s raw return value as already being expressed in synphot’s internal PHOTLAM (photon-count flux density per unit wavelength, not the energy-flux \(F_\lambda\) one might expect) – __call__() does not consult a wrapped model’s declared output units to convert.

Requires an observed (diluted) flux – at least one of redshift/the distance keywords – since a SourceSpectrum is meant to be a real per-area flux for Detector to consume, not a rest-frame luminosity.

Foreground (e.g. Milky Way) dust attenuation is optional: pass an already-resolved ebv (see resolve_ebv() for turning a dust map and sky position into one, as a separate prior step) and it’s folded into the native photon flux for you, inside this method’s own evaluation kernel, before the result is wrapped as a SourceSpectrum – applied here rather than through synphot’s own spectrum-composition operators (spectrum * extinction), and resolved to log_attenuation()’s callable form (via attenuation_callable()) internally, right here, rather than something a caller ever has to build. Doing it here rather than by composing two Model instances is what lets ebv stay vector-valued (e.g. one row per event) without resurrecting synphot’s n_models=1 restriction, exactly like every other parameter here (see model_class_from_kernel()) – the attenuation is just one more array multiplied in via plain NumPy broadcasting, not a second composed model.

Parameters:
  • t (array-like or Quantity) – Observed time since explosion, either a Quantity with time units or an already unit-stripped cgs (seconds) value. May carry leading batch axes, broadcastable against parameters.

  • redshift (array-like or Quantity, optional) – Exactly one of redshift or the three distance keywords must be given; the rest are derived from it using cosmology. See as_astropy_model().

  • luminosity_distance (Quantity, optional) – See redshift above.

  • angular_diameter_distance (Quantity, optional) – See redshift above.

  • proper_distance (Quantity, optional) – See redshift above.

  • cosmology (FLRW, optional) – See redshift above.

  • ebv (float, Quantity, or array-like, optional) – Already-resolved, dimensionless E(B-V) (see resolve_ebv()). None (the default) applies no dust attenuation.

  • dust_law (str, optional) – Passed through to get_dust_law(); the configured default (config["physics.default_dust_law"]) is almost always the right choice.

  • **parameters – This model’s parameter values, either Quantity or already unit-stripped cgs values (see eval_log_cgs()). May carry leading batch axes.

Returns:

Callable as spectrum(wave), returning the observed flux density at t.

Return type:

SourceSpectrum

Raises:

ValueError – If none of redshift/luminosity_distance/ angular_diameter_distance/proper_distance is given.