lentil.radiometry.Blackbody.vegamag#
- classmethod Blackbody.vegamag(wave, temp, mag, band, waveunit='nm', valueunit='photlam')[source]#
Create a
Blackbody
with its irradiance scaled to an apparent magnitude.- Parameters:
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
. Seevegaflux()
for supported bands.waveunit (str) – Wavelength units, as accepted by
Unit()
. Default isnm
.valueunit (str) – Flux units, as accepted by
Unit()
. Default isphotlam
.
Examples
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]')
Notes
This class implements a special formulation of a
Blackbody
which computes irradiance for a star given a magnitude \(mag\) in an observing band chosen fromvegaflux()
. The general calculation performed here is as follows:Look up zero point irradiance \(E_{\mbox{Vega}}\) and central wavelength \(\lambda_{0,\mbox{Vega}}\) in the desired observing band
Compute exitance \(M_0\) for the desired star at \(\lambda_{0,\mbox{Vega}}\)
Compute exitance \(M\) for the desired star over the requested wavelength range
Compute apparent magnitude scaling factor \(f = 10^{-0.4\mbox{mag}}\)
Compute star irradiance as \(E = E_{\mbox{Vega}} \ f \left(\frac{M}{M_0}\right)\)