Specialized Template Function phot::PhotConvert< PhotSystem::Fnu, PhotSystem::AB >
Defined in File PhotCommons.hpp
Function Documentation
-
template<>
inline auto phot::PhotConvert<PhotSystem::Fnu, PhotSystem::AB>(const double photIn, double) -> double Convert Fnu (erg/s/Hz, a specific luminosity) to an AB magnitude.
AB magnitudes are defined in terms of a flux, not a luminosity, so photIn is first divided by fourPiTenPcSq to convert it to the flux that would be observed at the standard distance of 10 pc (see fourPiTenPcSq’s own comment), and then by utils::Jy to convert that flux from erg/s/cm^2/Hz to Jy – the units flux0AB (the AB system’s zero point) is itself expressed in – before applying the standard AB-magnitude formula. flux0AB is a fixed value in Jy, independent of wavelength, so wl goes unused here. Not marked constexpr, unlike the Flambda <-> Fnu conversions above: std::log10 isn’t a constexpr function in C++23 (only as of C++26), and while Clang currently accepts it as an extension even in C++23 mode, GCC cannot be relied on to be as permissive, so this only ever actually needs to run at runtime anyway. Explicitly inline, unlike the constexpr specializations above (which are already implicitly inline): an explicit full specialization that isn’t constexpr is an ordinary function, and defining an ordinary, non-inline function in a header risks an ODR violation if the header is included from more than one translation unit.