29 #ifndef LSST_AFW_IMAGE_CALIB_H 30 #define LSST_AFW_IMAGE_CALIB_H 35 #include "ndarray_fwd.h" 50 namespace cameraGeom {
55 static double const JanskysPerABFlux = 3631.0;
62 return std::abs(fluxErr / (-0.4 * flux *
std::log(10)));
76 ndarray::Array<T, 1>
abMagFromFlux(ndarray::Array<T const, 1>
const& flux);
81 ndarray::Array<T const, 1>
const& flux);
85 ndarray::Array<T, 1>
fluxFromABMag(ndarray::Array<T const, 1>
const& mag);
90 ndarray::Array<T const, 1>
const& mag);
125 void setFluxMag0(
double fluxMag0,
double fluxMag0Sigma = 0.0);
140 double getFlux(
double const mag)
const;
152 ndarray::Array<double, 1> getFlux(ndarray::Array<double const, 1>
const& mag)
const;
155 ndarray::Array<double const, 1>
const& mag, ndarray::Array<double const, 1>
const& magErr)
const;
162 double getMagnitude(
double const flux)
const;
172 ndarray::Array<double, 1> getMagnitude(ndarray::Array<double const, 1>
const& flux)
const;
175 ndarray::Array<double const, 1>
const& flux,
176 ndarray::Array<double const, 1>
const& fluxErr)
const;
183 static void setThrowOnNegativeFlux(
bool raiseException);
187 static bool getThrowOnNegativeFlux();
198 (*this) *= 1.0 /
scale;
211 double _fluxMag0Sigma;
215 static bool _throwOnNegativeFlux;
231 #endif // LSST_AFW_IMAGE_CALIB_H ndarray::Array< T, 1 > fluxFromABMag(ndarray::Array< T const, 1 > const &mag)
Compute flux in Janskys from AB magnitude.
table::Key< double > fluxMag0Sigma
Calib & operator/=(double const scale)
An object passed to Persistable::write to allow it to persist itself.
def scale(algorithm, min, max=None, frame=None)
bool operator==(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
Describe an exposure's calibration.
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
A base class for objects that can be persisted via afw::table::io Archive classes.
void operator*=(ExtentBase< int, N > &lhs, double rhs)
A base class for image defects.
bool operator!=(Calib const &rhs) const
int stripCalibKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Calib-related keywords from the metadata.
ndarray::Array< T, 1 > abMagFromFlux(ndarray::Array< T const, 1 > const &flux)
Compute AB magnitude from flux in Janskys.
ndarray::Array< T, 1 > abMagErrFromFluxErr(ndarray::Array< T const, 1 > const &fluxErr, ndarray::Array< T const, 1 > const &flux)
Compute AB magnitude error from flux and flux error in Janskys.
table::Key< double > fluxMag0
ndarray::Array< T, 1 > fluxErrFromABMagErr(ndarray::Array< T const, 1 > const &magErr, ndarray::Array< T const, 1 > const &mag)
Compute flux error in Janskys from AB magnitude error and AB magnitude.
A CRTP facade class for subclasses of Persistable.