31 #ifndef LSST_AFW_IMAGE_CALIB_H
32 #define LSST_AFW_IMAGE_CALIB_H
37 #include "ndarray_fwd.h"
51 namespace cameraGeom {
56 static double const JanskysPerABFlux = 3631.0;
60 return -2.5*std::log10(flux/JanskysPerABFlux);
65 return std::abs(fluxErr/(-0.4*flux*
std::log(10)));
70 return std::pow(10.0, -0.4*mag)*JanskysPerABFlux;
84 typedef std::shared_ptr<Calib>
Ptr;
93 void setFluxMag0(std::pair<double, double> fluxMag0AndSigma);
96 double getFlux(
double const mag)
const;
98 std::pair<double, double>
getFlux(
double const mag,
double const magErr)
const;
100 ndarray::Array<double,1>
getFlux(ndarray::Array<double const,1>
const & mag)
const;
102 std::pair< ndarray::Array<double,1>, ndarray::Array<double,1> >
getFlux(
103 ndarray::Array<double const,1>
const & mag,
104 ndarray::Array<double const,1>
const & magErr
109 std::pair<double, double>
getMagnitude(
double const flux,
double const fluxErr)
const;
111 ndarray::Array<double,1>
getMagnitude(ndarray::Array<double const,1>
const & flux)
const;
113 std::pair< ndarray::Array<double,1>,ndarray::Array<double,1> >
getMagnitude(
114 ndarray::Array<double const,1>
const & flux,
115 ndarray::Array<double const,1>
const & fluxErr
149 #endif // LSST_AFW_IMAGE_CALIB_H
A coordinate class intended to represent absolute positions.
table::Key< double > fluxMag0Sigma
double abMagErrFromFluxErr(double fluxErr, double flux)
Compute AB magnitude error from flux and flux error in Janskys.
double fluxErrFromABMagErr(double magErr, double mag)
Compute flux error in Janskys from AB magnitude error and AB magnitude.
io::OutputArchiveHandle OutputArchiveHandle
void operator*=(double const scale)
double abMagFromFlux(double flux)
Compute AB magnitude from flux in Janskys.
Describe an exposure's calibration.
table::Key< table::Array< Kernel::Pixel > > image
A base class for objects that can be persisted via afw::table::io Archive classes.
double fluxFromABMag(double mag)
Compute flux in Janskys from AB magnitude.
bool operator==(Calib const &rhs) const
Are two Calibs identical?
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
static void setThrowOnNegativeFlux(bool raiseException)
Set whether Calib should throw an exception when asked to convert a flux to a magnitude.
std::pair< double, double > getFluxMag0() const
Return the flux, and error in flux, of a zero-magnitude object.
static bool _throwOnNegativeFlux
Control whether we throw an exception when faced with a negative flux.
Interface for DateTime class.
int stripCalibKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Calib-related keywords from the metadata.
double getFlux(double const mag) const
Return a flux (in ADUs) given a magnitude.
void operator/=(double const scale)
Class for storing generic metadata.
std::shared_ptr< Calib const > ConstPtr
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
std::shared_ptr< Calib > Ptr
void setFluxMag0(double fluxMag0, double fluxMag0Sigma=0.0)
Set the flux of a zero-magnitude object.
static bool getThrowOnNegativeFlux()
Tell me whether Calib will throw an exception if asked to convert a flux to a magnitude.
table::Key< double > fluxMag0
bool operator!=(Calib const &rhs) const
#define CONST_PTR(...)
A shared pointer to a const object.
A CRTP facade class for subclasses of Persistable.
double getMagnitude(double const flux) const
Return a magnitude given a flux.
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.