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;
101 void setFluxMag0(std::pair<double, double> fluxMag0AndSigma);
104 double getFlux(
double const mag)
const;
106 std::pair<double, double>
getFlux(
double const mag,
double const magErr)
const;
108 ndarray::Array<double,1>
getFlux(ndarray::Array<double const,1>
const & mag)
const;
110 std::pair< ndarray::Array<double,1>, ndarray::Array<double,1> >
getFlux(
111 ndarray::Array<double const,1>
const & mag,
112 ndarray::Array<double const,1>
const & magErr
117 std::pair<double, double>
getMagnitude(
double const flux,
double const fluxErr)
const;
119 ndarray::Array<double,1>
getMagnitude(ndarray::Array<double const,1>
const & flux)
const;
121 std::pair< ndarray::Array<double,1>,ndarray::Array<double,1> >
getMagnitude(
122 ndarray::Array<double const,1>
const & flux,
123 ndarray::Array<double const,1>
const & fluxErr
159 #endif // LSST_AFW_IMAGE_CALIB_H
A coordinate class intended to represent absolute positions.
Class for handling dates/times, including MJD, UTC, and TAI.
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.
void operator*=(double const scale)
double abMagFromFlux(double flux)
Compute AB magnitude from flux in Janskys.
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
table::Key< std::int64_t > midTime
void setExptime(double exptime)
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
static void setThrowOnNegativeFlux(bool raiseException)
double getExptime() const
std::pair< double, double > getFluxMag0() const
static bool _throwOnNegativeFlux
Interface for DateTime class.
int stripCalibKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > metadata)
double getFlux(double const mag) const
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)
io::OutputArchiveHandle OutputArchiveHandle
static bool getThrowOnNegativeFlux()
table::Key< double > fluxMag0
bool operator!=(Calib const &rhs) const
lsst::daf::base::DateTime getMidTime() const
A CRTP facade class for subclasses of Persistable.
lsst::daf::base::DateTime _midTime
double getMagnitude(double const flux) const
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
void setMidTime(lsst::daf::base::DateTime const &midTime)