ab_reference_flux

speclite.filters.ab_reference_flux(wavelength, magnitude=0.0)[source] [edit on github]

Calculate an AB reference spectrum with the specified magnitude.

For example, to calculate the flux of a 20th magnitude AB reference at 600 nm:

>>> flux = ab_reference_flux(600 * astropy.units.nanometer, magnitude=20)
>>> print('{0:.3g}'.format(flux))
3.02e-17 erg / (Angstrom cm2 s)

This function is used to calculate filter response zeropoints in the AB system.

If either of the parameters is an array, the result will be broadcast over the parameters using the usual numpy rules.

Parameters:
wavelengthastropy.units.Quantity

Wavelength or array of wavelengths where the flux should be evaluated. Wavelengths must have valid units.

magnitudefloat or array

Dimensionless magnitude value(s) used to normalize the spectrum.

Returns:
astropy.units.Quantity

Spectral flux densities per unit wavelength tabulated at each input wavelength, in units of default_flux_unit.

Raises:
ValueError

Wavelength parameter does not have valid units.