LSSTApplications  19.0.0-14-gb0260a2+64befe7c1c,20.0.0+0b340dd7c4,20.0.0+1540ce6389,20.0.0+7c6b12c2f9,20.0.0+ae956f52c5,20.0.0+be870186d9,20.0.0+e2e26847c2,20.0.0-1-g04bee24+7c6b12c2f9,20.0.0-1-g10df615+fbe45b1aff,20.0.0-1-g253301a+7c6b12c2f9,20.0.0-1-g2b7511a+46a6078777,20.0.0-1-g4d801e7+9d50d6c21a,20.0.0-1-g5b95a8c+8ebfc75efb,20.0.0-1-gb058bd0+46a6078777,20.0.0-1-gb88604f+acecce4127,20.0.0-1-gc96f8cb+016e330d09,20.0.0-1-gedffbd8+83814edeba,20.0.0-10-g0891cd99+a5f14e9acb,20.0.0-10-g9a20bd332+576ca7b471,20.0.0-17-gcdbda88+0e26bfb1e6,20.0.0-2-g4dae9ad+016e330d09,20.0.0-2-g61b8584+85c46248f3,20.0.0-2-gb780d76+f45b7d88f4,20.0.0-21-g9bbb7f7+016e330d09,20.0.0-22-gc512666+f30f3883a7,20.0.0-23-g8900aa8+68630f7098,20.0.0-3-g1653f94+85c46248f3,20.0.0-3-g4cc78c6+63636aeed8,20.0.0-3-g750bffe+e05f822de9,20.0.0-3-gbd60e8c+ff10c6d78d,20.0.0-32-g15a0e07c+a4c9d0309b,20.0.0-4-g97dc21a+68630f7098,20.0.0-4-gfea843c+f45b7d88f4,20.0.0-5-g357b56b+f45b7d88f4,20.0.0-6-g9a5b7a1+b0f8c2be93,20.0.0-60-gad89340+e4dd172200,20.0.0-7-gcda7bf1+673816f70c,w.2020.43
LSSTDataManagementBasePackage
Namespaces | Functions | Variables
Magnitude.h File Reference

Utilities for converting between flux and magnitude in C++. More...

#include <cmath>

Go to the source code of this file.

Namespaces

 lsst
 A base class for image defects.
 
 lsst::utils
 

Functions

double lsst::utils::nanojanskyToABMagnitude (double flux)
 Convert a flux in nanojansky to AB magnitude. More...
 
double lsst::utils::ABMagnitudeToNanojansky (double magnitude)
 Convert an AB magnitude to a flux in nanojansky. More...
 

Variables

const double lsst::utils::referenceFlux = 1e23 * pow(10, (48.6 / -2.5)) * 1e9
 The Oke & Gunn (1983) AB magnitude reference flux, in nJy (often approximated as 3631.0). More...
 

Detailed Description

Utilities for converting between flux and magnitude in C++.

Use astropy.units ABmag and nJy for converstions in python:

import astropy.units as u
mag = (flux*u.nJy).to_value(u.ABmag)
flux = (mag*u.ABmag).to_value(u.nJy)

Definition in file Magnitude.h.