uvex_transients.utils.phot_utils.luminosity_to_absolute_magnitude#

uvex_transients.utils.phot_utils.luminosity_to_absolute_magnitude(luminosity: Quantity, bandpass: SpectralElement) → Quantity[source]#

Convert a band luminosity to an absolute AB magnitude, by the distance modulus of a flat spectrum.

The spectrum is taken to be flat in \(L_\nu\), so that \(L_\nu=L_\mathrm{band}/\Delta\nu\) with \(\Delta\nu\) the equivalent_bandwidth of the band, and the magnitude is that of this \(L_\nu\) seen from 10 pc. It is the AB magnitude a flat-spectrum source with this band luminosity would have, which is not exactly the photon-weighted band magnitude of an SED with colour; it is a fixed, monotonic conversion of the luminosity.

Parameters:
  • luminosity (Quantity) – The luminosity in the band, in units of erg/s. Any shape.

  • bandpass (synphot.SpectralElement) – The band that luminosity is in, for example one of a detector’s bandpasses.

Returns:

The absolute AB magnitude, in ~astropy.units.ABmag, with the shape of luminosity. NaN stays NaN and zero luminosity is an infinitely faint magnitude.

Return type:

Quantity