23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H 24 #define LSST_AFW_IMAGE_PHOTOCALIB_H 32 #include "boost/format.hpp" 68 (boost::format(
"%s must be positive: %.3g") % name % value).str());
135 : _calibrationMean(calibrationMean), _calibrationErr(
calibrationErr), _isConstant(true) {
138 ndarray::Array<double, 2, 2> coeffs = ndarray::allocate(ndarray::makeVector(1, 1));
140 _calibration = std::make_shared<afw::math::ChebyshevBoundedField>(
151 : _calibration(calibration),
152 _calibrationMean(computeCalibrationMean(calibration)),
155 assertNonNegative(_calibrationMean,
"Calibration (computed via BoundedField.mean()) mean");
169 : _calibration(calibration),
170 _calibrationMean(calibrationMean),
171 _calibrationErr(calibrationErr),
172 _isConstant(isConstant) {
190 double instFluxToNanojansky(
double instFlux)
const;
203 Measurement instFluxToNanojansky(
double instFlux,
double instFluxErr,
207 Measurement instFluxToNanojansky(
double instFlux,
double instFluxErr)
const;
267 double instFluxToMagnitude(
double instFlux)
const;
280 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr,
284 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr)
const;
345 bool includeScaleUncertainty =
true)
const;
361 double magnitudeToInstFlux(
double magnitude)
const;
464 double _calibrationMean;
467 double _calibrationErr;
485 ndarray::Array<double, 2, 2>
result)
const;
488 ndarray::Array<double, 2, 2> result)
const;
495 #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.
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.
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.
Measurement(double value, double error)
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.
const double referenceFlux
A CRTP facade class for subclasses of Persistable.
double getInstFluxAtZeroMagnitude() const
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude).