mag_ab

skypy.galaxy.spectrum.mag_ab(spectrum, bandpass, redshift=None)[source] [edit on github]

Compute absolute AB magnitudes from spectra and bandpasses.

This function takes emission spectra and observation bandpasses and computes the AB magnitudes. The definition of the bandpass AB magnitude is taken from [1]. The emission spectra can optionally be redshifted and the bandpasses should have dimensionless flux units.

Parameters
spectrumspectral_data

Emission spectra of the sources.

bandpassspectral_data

Bandpass filters.

redshift(nz,) array_like, optional

Optional array of values for redshifting the source spectra.

Returns
mag_ab(nz, nb, ns) array_like

Absolute AB magnitudes.

References

1
    1. Blanton et al., 2003, AJ, 125, 2348

Examples

Get B-band magnitudes for the kcorrect spec templaces using auto-loading of known spectral data: >>> from skypy.galaxy.spectrum import mag_ab >>> mag_B = mag_ab(‘kcorrect_spec’, ‘Johnson_B’) # doctest: +SKIP