23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H 24 #define LSST_AFW_IMAGE_PHOTOCALIB_H 32 #include "boost/format.hpp" 67 (boost::format(
"%s must be positive: %.3g") % name % value).str());
127 : _calibrationMean(calibrationMean), _calibrationErr(
calibrationErr), _isConstant(true) {
130 ndarray::Array<double, 2, 2> coeffs = ndarray::allocate(ndarray::makeVector(1, 1));
132 _calibration = std::make_shared<afw::math::ChebyshevBoundedField>(
143 : _calibration(calibration),
144 _calibrationMean(computeCalibrationMean(calibration)),
147 assertNonNegative(_calibrationMean,
"Calibration (computed via BoundedField.mean()) mean");
161 : _calibration(calibration),
162 _calibrationMean(calibrationMean),
163 _calibrationErr(calibrationErr),
164 _isConstant(isConstant) {
182 double instFluxToMaggies(
double instFlux)
const;
195 Measurement instFluxToMaggies(
double instFlux,
double instFluxErr,
199 Measurement instFluxToMaggies(
double instFlux,
double instFluxErr)
const;
262 double instFluxToMagnitude(
double instFlux)
const;
275 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr,
279 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr)
const;
357 double magnitudeToInstFlux(
double magnitude)
const;
461 double _calibrationMean;
464 double _calibrationErr;
484 ndarray::Array<double, 2, 2> result)
const;
491 #endif // LSST_AFW_IMAGE_PHOTOCALIB_H table::Key< double > calibrationErr
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
PhotoCalib(double calibrationMean, double calibrationErr, std::shared_ptr< afw::math::BoundedField > calibration, bool isConstant)
Create a calibration with a pre-computed mean.
double getCalibrationMean() const
Get the mean photometric calibration (equal to 1 / getInstFluxMag0()).
An object passed to Persistable::write to allow it to persist itself.
The photometric calibration of an exposure.
table::Key< table::Flag > isConstant
bool operator!=(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal...
ItemVariant const * other
table::Key< double > calibrationMean
PhotoCalib(double calibrationMean, double calibrationErr=0, lsst::geom::Box2I const &bbox=lsst::geom::Box2I())
Create a non-spatially-varying calibration.
A base class for objects that can be persisted via afw::table::io Archive classes.
Measurement(double value, double err)
std::ostream & operator<<(std::ostream &os, VisitInfo const &visitInfo)
A base class for image defects.
PhotoCalib(std::shared_ptr< afw::math::BoundedField > calibration, double calibrationErr=0)
Create a spatially-varying calibration.
A class to manipulate images, masks, and variance as a single object.
PhotoCalib()
Create a empty, zeroed calibration.
std::unique_ptr< SchemaItem< U > > result
double getCalibrationErr() const
Get the mean photometric calibration error.
#define LSST_EXCEPT(type,...)
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
Record class that contains measurements made on a single exposure.
void assertNonNegative(double value, std::string const &name)
Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0.
double getInstFluxMag0() const
Get the magnitude zero point (equal to 1 / mean(calibration)).
A CRTP facade class for subclasses of Persistable.