classmethod Blackbody.vegamag(wave, temp, mag, band, waveunit='nm', valueunit='photlam')[source]

Create a Blackbody with its irradiance scaled to an apparent magnitude.

  • wave (array_like) – Array of wavelengths or wavenumbers

  • temp (float) – Temperature in K

  • mag (float) – Apparent magnitude

  • band (str) – Observing band closest to the wavelengths in wave. See vegaflux() for supported bands.

  • waveunit (str) – Wavelength units, as accepted by Unit(). Default is nm.

  • valueunit (str) – Flux units, as accepted by Unit(). Default is photlam.


Create a Blackbody object with wavelength range 400-900 nm, a temperature of 4000K, and a visible magnitude of 2:

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> import lentil
>>> wave = np.arange(400,900)
>>> temp = 5000
>>> mag = 2
>>> band = 'V'  # Chosen for best overlap with wavelength range
>>> src = lentil.radiometry.Blackbody.vegamag(wave,temp,mag,band,waveunit='nm')
>>> plt.plot(src.wave, src.value), plt.grid()
>>> plt.xlabel('Wavelength [nm]'), plt.ylabel('Flux [photons/sec/m^2]')


This class implements a special formulation of a Blackbody which computes irradiance for a star given a magnitude \(mag\) in an observing band chosen from vegaflux(). The general calculation performed here is as follows:

  1. Look up zero point irradiance \(E_{\mbox{Vega}}\) and central wavelength \(\lambda_{0,\mbox{Vega}}\) in the desired observing band

  2. Compute exitance \(M_0\) for the desired star at \(\lambda_{0,\mbox{Vega}}\)

  3. Compute exitance \(M\) for the desired star over the requested wavelength range

  4. Compute apparent magnitude scaling factor \(f = 10^{-0.4\mbox{mag}}\)

  5. Compute star irradiance as \(E = E_{\mbox{Vega}} \ f \left(\frac{M}{M_0}\right)\)