uvex_transients.models.supernovae.IIb.MoragShockCoolingSED.as_astropy_model#

classmethod MoragShockCoolingSED.as_astropy_model(x_type: str = 'lambda', y_type: str = 'lambda', *, y_kind: str = 'energy', wave_unit: str | UnitBase = Unit('Angstrom'), freq_unit: str | UnitBase = Unit('Hz'), redshift: PhysicalInput | None = None, luminosity_distance: Quantity | None = None, angular_diameter_distance: Quantity | None = None, proper_distance: Quantity | None = None, cosmology: FLRW | None = None, **parameters: ParameterValue) → Model#

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

This method is the single entry point for converting a SpectralModel into a model compatible with synphot / astropy.modeling / m4opt.synphot. Several parameters can be modified to specify exactly what type of spectral model to generate:

  • x_type: May be either "lambda" or "nu" to control what input the model expects.

  • y_type: May be either "lambda" or "nu". If "lambda", then \(F_\lambda\) is generated, otherwise \(F_\nu\) is generated.

  • y_kind: May be either "energy" or "photon". If "energy", then the output is an energy-flux density (\(F_\nu\)/\(F_\lambda\)). If "photon", then the output is a photon count flux density.

Additionally, any of a number of cosmological parameters may be specified to provide the distance from the source. If any of these are provided, the model will generate a flux density. Otherwise a luminosity density is produced.

Parameters:
  • x_type (str) – "lambda" (the default) if the model’s first input is a wavelength, or "nu" if it is a frequency.

  • y_type (str) – "lambda" (the default) if the output is expressed per unit wavelength, or "nu" if per unit frequency.

  • y_kind (str) – "energy" (the default) for an energy-flux density, or "photon" for a photon-count-flux density (dividing by the photon energy \(h\nu\)).

  • wave_unit (str or UnitBase) – The wavelength unit used wherever x_type/y_type is "lambda".

  • freq_unit (str or UnitBase) – The frequency unit used wherever x_type/y_type is "nu".

  • redshift (array-like or Quantity, optional) – If any of redshift/luminosity_distance/ angular_diameter_distance/proper_distance is given, exactly one of them must be given; the rest (and cosmology) are as in flux_log(), and the output is the observed, diluted flux. If none of the four is given, the output is the rest-frame luminosity and cosmology is ignored.

  • 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.

  • **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 model(x, t), with x/t either bare numbers (x in wave_unit/freq_unit, t in seconds) or Quantity. Unit-attached only when at least one of x/t was itself a Quantity (a property of astropy.modeling.Model.__call__(), not something this method controls).

Return type:

Model

Raises:

ValueError – If x_type/y_type is not "lambda"/"nu", if y_kind is not "energy"/"photon", or if wave_unit/freq_unit is not a wavelength/frequency unit.