cphot 0.1
A C++ tool for computing photometry from spectra.
Details on predicting photometry

It is sometimes not evident that there are essential differences between photometric systems. But even less known, the difference between detector count types (energy or photons) requires special care.

This section reviews the essential details for computing the luminosity and magnitude of a star through a photometric passband filter. We do not discuss calibration, which instrument documentations cover, in principle.

Let's consider a filter throughput (a.k.a, transmission curve, or response function) defined in wavelength by the dimensionless function \(T(\lambda)\). This function tells you what fraction of the arriving photons at wavelength \(\lambda\) get through the instrument. Therefore, the total number of photons, per unit time per unit area, received in this filter is

$$N_{tot} = \frac{1}{hc} \int_\lambda f_\lambda\,\lambda\,T(\lambda)\,d\lambda,$$

where \(f_\lambda\) is the wavelength-dependent flux density of an object given in energy per unit time per unit area per unit wavelength.

Consequently, interpreting \(\lambda T(\lambda)\) as a distribution leads to the statistical mean of the flux density, \(\overline{f_\lambda}\):

$$\overline{f_\lambda}(T) = \frac{\int_\lambda \lambda f_\lambda T(\lambda) d\lambda}{\int_\lambda \lambda T(\lambda) d\lambda}.$$

Note that this is not the mean flux density because of the \(\lambda\) factor in the integrals. It is the mean photon rate density in this filter commonly expressed in stellar physics literature as \(erg.s^{-1}.cm^{-2}.Å^{-1}\) or \(W.m^{-2}.nm^{-1}\).

Example: (the code links to the API documentation)

#include <cphot/filter.hpp>
#include <cphot/io.hpp> // svo webservice
#include <cphot/rquantities.hpp> // units
// compute the mean flux density in this filter
// note the units as arguments
auto flux = filt.get_flux(lamb, spec, nm, flam);

Finally, at least for instruments using CCD or CCD-like cameras, i.e., counting photons, we obtain the usual definition of a magnitude

$$mag_\lambda(T) = -2.5\,\log_{10}\left(\overline{f_\lambda}\right) - ZP\left(\overline{f_\lambda}\right),$$

where \(ZP(\overline{f_\lambda})\) gives the pass-band reference value (zeropoint) for a given photometric/magnitude system.

However, the zeropoints themselves depend on the adopted photometric system used to report the measurements. They may vary fundamentally from one to another. Below we briefly describe the primary systems used in large surveys.

Vega magnitude system

This system is defined such that the star Alpha Lyr (Vega) has magnitude 0 in any passband filter. In other words, the zeropoints are set by the magnitude of vega, \(-2.5 \log_{10} \overline{f_\lambda}(Vega)\), or

$$mag_{Vega}(T) = -2.5\,\log_{10}\left(\overline{f_\lambda} / \overline{f_\lambda}(Vega)\right).$$

Example:

#include <cphot/filter.hpp>
#include <cphot/io.hpp> // svo webservice
#include <cphot/rquantities.hpp> // units
#include <cmath>
cphot::Filter filt = cphot::download_svo_filter("HST/WFC3_IR.F110W");
double flux = filt.get_flux(lamb, spec, nm, flam).to(flam);
double mags_a = -2.5 * std::log10(flux) - filt.get_Vega_zero_mag();
// or similarly (note the use of the units)
double mags_b = -2.5 * std::log10(flux / filt.get_Vega_zero_flux().to(flam));

Johnson system

The Johson system is defined such that the star Alpha Lyr (Vega) has \(V=0.03\) and all colors equal to zero. It is very similar to the Vega magnitude system, but using mean flux definition (instead of photon counts), i.e., energy counter detectors

$$\widetilde{f_\lambda}(T) = \frac{\int_\lambda f_\lambda T(\lambda) d\lambda}{\int_\lambda T(\lambda) d\lambda},$$

(the true definition of mean flux throughout a given transmission filter.)

Note: Table A2 of Bessell et al. (1998) gives zero points for the UBVRIJHKL(+Kp and L’) filters in the

Cousins-Glass-Johnson system.

If one defines the effective wavelength \(\lambda_{\rm eff}\) as the photon weighted mean wavelength:

$$\lambda_{\rm eff} = \frac{\int \lambda f_\lambda T(\lambda) d\lambda}{\int f_\lambda T(\lambda) d\lambda},$$

//the effective wavelength for vega is given by
cphot::download_svo_filter("Generic/Johnson.U").get_leff();

then the difference between the Johnson and Vega systems within the same filter is given by

$$\widetilde{mag}_\lambda - \overline{mag}_\lambda = 0.03 - 2.5 \log_{10} \frac{\lambda_{\rm eff}(Vega)}{\lambda_{\rm eff}(star)},$$ where we explicit which equation was used to compute magnitudes.

AB magnitude system

This system is defined such that, when monochromatic flux \(f_\nu\) is measured in \(erg\,s^{-1}\,cm^{-2} Hz^{-1}\),

$$mag_{AB}(T) = -2.5\, \log_{10}(\overline{f_\nu}) - 48.60,$$ where the value of the constant is selected to define \(m_{AB}=0\) for a flat-spectrum source. In this system, an object with constant flux per unit frequency interval has zero color.

Koornneef et al. gives the respective definition of \(\overline{f_\nu}(T)\):

$$\overline{f_\nu}(T) = \frac{\int_\nu f_\nu T(\nu) d\nu / \nu}{\int_\nu T(\nu) d\nu / \nu} = \frac{\int_\lambda f_\nu T(\lambda) d\lambda / \lambda}{\int_\lambda T(\lambda) d\lambda / \lambda}$$

To go back to wavelength units, we have \(d\nu = (c/\lambda^2) d\lambda\).

If one defines the pivot wavelength \(\lambda_p\) to convert between \(\overline{f_\nu}\) and \(\overline{f_\lambda}\) as

$$\overline{f_\nu} = \frac{\lambda_p^2}{c} \overline{f_\lambda},$$

one can easily show that

$$\lambda_p^2 = \frac{\int_\lambda T(\lambda)\,\lambda\,d\lambda}{\int_\lambda T(\lambda)\,d\lambda /\lambda}.$$

//the pivot wavelength for a filter is given by
cphot::download_svo_filter("Generic/Johnson.U").get_lpivot();

Therefore for filters with AB magnitudes, one can compute

$$mag_{AB}(T) = -2.5\, \log_{10}(\overline{f_\lambda}) - 2.5\log_{10}\left(\lambda_p^2/c\right) - 48.6,$$ where one must care to use the speed of light \(c\) and \(\lambda_p\) in matching units.

#include <cphot/filter.hpp>
#include <cphot/io.hpp>
#include <cmath>
cphot::Filter filt = cphot::download_svo_filter("HST/WFC3_IR.F110W");
double flux = filt.get_flux(lamb, spec, nm, flam).to(flam);
// Simlarly to before ("Vega" -> "AB")
double mags_a = -2.5 * std::log10(flux) - filt.get_AB_zero_mag();
// or similarly (note the use of the units)
double mags_b = -2.5 * std::log10(flux / filt.get_AB_zero_flux().to(flam));

ST magnitude system

This system is defined such as a source with flat \(f_\lambda\) will have the same magnitude in every filter.

Koornneef et al. (1986; same as above) defines $$mag_{ST}(T) = -2.5\, \log_{10}(\overline{f_\lambda}) - 21.1,$$

#include <cphot/filter.hpp>
#include <cphot/io.hpp>
#include <cmath>
cphot::Filter filt = cphot::download_svo_filter("HST/WFC3_IR.F110W");
double flux = filt.get_flux(lamb, spec, nm, flam).to(flam);
// Simlarly to before ("Vega" -> "ST")
double mags_a = -2.5 * std::log10(flux) - filt.get_ST_zero_mag();
// or similarly (note the use of the units)
double mags_b = -2.5 * std::log10(flux / filt.get_ST_zero_flux().to(flam));

Jansky definition

The jansky (symbol Jy) is a non-SI unit of spectral flux density, it is equivalent to \(10^{−26}.W.m^{-2}.Hz^{-1}\) or \(10^{-23}.erg.s^{-1}.cm^{-2}.Å^{-1}\).

$${f_{Jy}} = \frac{10^5}{10^{-8}c} {\lambda_p^2} {f_\lambda},$$ where \(c\) is the speed of light in \(m/s\), \(\lambda_p\) is the pivot wavelength in \(Å\), and \({f_\lambda}\) the flux (Vega, AB, or ST) in flam ( \(erg.s^{-1}.cm^{-2}.Å^{-1}\)).

#include <iostream>
#include <cphot/filter.hpp>
#include <cphot/io.hpp>
cphot::Filter filt = cphot::download_svo_filter("HST/WFC3_IR.F110W");
std::cout << filt.get_AB_zero_Jy() << " "
<< filt.get_Vega_zero_Jy() << " "
<< filt.get_ST_zero_Jy() << std::endl;

References

  • Bessel, M. S. 1990, PASP, 91, 589 - _"UBVRI passbands."_ [1990PASP..102.1181B];
  • Bessel, M. S. 1998, A&A, 333, 231 - _"Model atmospheres broad-band colors, bolometric corrections and temperature calibrations for O - M stars."_ [1998A%26A...333..231B]
  • Koornneef, Bohlin, Buser, Horne, Turnshek, 1986, Highlights of astronomy 7 - _"Synthetic photometry and the calibration of HST"._ [1986HiA.....7..833K]
  • Bessel, M. S. 1983, PASP, 95, 480;
  • Bessel, M. S. 1990, PASP, 102, 1181;
  • Hayes, D. S., & Latham, D. W. 1975, ApJ, 197, 593;
  • Johnson, H. L. & Morgan, W. W. 1953, ApJ, 117, 313
  • Oke, J.B. 1974, ApJS, 27, 21;
cphot::Filter::get_AB_zero_Jy
QSpectralFluxDensity get_AB_zero_Jy()
AB flux zero point in Jansky (Jy)
Definition: filter.hpp:295
filter.hpp
cphot::Filter::get_Vega_zero_Jy
QSpectralFluxDensity get_Vega_zero_Jy()
Vega flux zero point in Jansky (Jy)
Definition: filter.hpp:373
cphot_sun_theoretical::flux
const std::vector< double > flux
Definition: sun_data.hpp:17
rquantities.hpp
cphot::Filter::get_flux
QSpectralFluxDensity get_flux(const DMatrix &wavelength, const DMatrix &flux, const QLength &wavelength_unit, const QSpectralFluxDensity &flux_unit)
Integrate the flux within the filter and return the integrated energy/flux.
Definition: filter.hpp:402
cphot::Filter::get_Vega_zero_mag
double get_Vega_zero_mag()
Vega magnitude zero point.
Definition: filter.hpp:345
io.hpp
cphot::Filter
Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation.
Definition: filter.hpp:43
cphot::Filter::get_lpivot
QLength get_lpivot()
Pivot wavelength in nm.
Definition: filter.hpp:517
cphot::Filter::get_ST_zero_mag
double get_ST_zero_mag()
ST magnitude zero point.
Definition: filter.hpp:308
cphot::Filter::get_ST_zero_Jy
QSpectralFluxDensity get_ST_zero_Jy()
ST flux zero point in Jansky (Jy)
Definition: filter.hpp:334
cphot::download_svo_filter
Filter download_svo_filter(const std::string &id)
main interface to SVO data requests
Definition: io.hpp:79
cphot::Filter::get_leff
QLength get_leff()
Effective wavelength.
Definition: filter.hpp:580
cphot::Filter::get_Vega_zero_flux
QSpectralFluxDensity get_Vega_zero_flux()
Vega flux zero point.
Definition: filter.hpp:354
cphot::Filter::get_AB_zero_flux
QSpectralFluxDensity get_AB_zero_flux()
AB flux zero point.
Definition: filter.hpp:281
nm
constexpr QLength nm
Definition: rquantities.hpp:273
cphot::Filter::get_AB_zero_mag
double get_AB_zero_mag()
AB magnitude zero point.
Definition: filter.hpp:266
flam
constexpr QSpectralFluxDensity flam
Definition: rquantities.hpp:361
cphot::Filter::get_ST_zero_flux
QSpectralFluxDensity get_ST_zero_flux()
ST flux zero point.
Definition: filter.hpp:320