23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H 24 #define LSST_AFW_IMAGE_PHOTOCALIB_H 104 explicit PhotoCalib(
double calibrationMean,
double calibrationErr = 0,
106 : _calibrationMean(calibrationMean), _calibrationErr(calibrationErr), _isConstant(true) {
107 ndarray::Array<double, 2, 2> coeffs = ndarray::allocate(ndarray::makeVector(1, 1));
108 coeffs[0][0] = calibrationMean;
109 _calibration = std::make_shared<afw::math::ChebyshevBoundedField>(
120 : _calibration(calibration),
121 _calibrationMean(computeCalibrationMean(calibration)),
122 _calibrationErr(calibrationErr),
123 _isConstant(false) {}
135 : _calibration(calibration),
136 _calibrationMean(calibrationMean),
137 _calibrationErr(calibrationErr),
138 _isConstant(isConstant) {}
153 double instFluxToMaggies(
double instFlux)
const;
166 Measurement instFluxToMaggies(
double instFlux,
double instFluxErr,
170 Measurement instFluxToMaggies(
double instFlux,
double instFluxErr)
const;
233 double instFluxToMagnitude(
double instFlux)
const;
246 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr,
250 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr)
const;
310 double magnitudeToInstFlux(
double magnitude)
const;
414 double _calibrationMean;
417 double _calibrationErr;
427 std::string const &instFluxField, ndarray::Array<double, 2, 2> result)
const;
430 ndarray::Array<double, 2, 2> result)
const;
436 #endif // LSST_AFW_IMAGE_PHOTOCALIB_H
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.
bool operator!=(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal...
bool operator==(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
An integer coordinate rectangle.
A base class for objects that can be persisted via afw::table::io Archive classes.
Measurement(double value, double err)
A base class for image defects.
PhotoCalib(double calibrationMean, double calibrationErr=0, afw::geom::Box2I const &bbox=afw::geom::Box2I())
Create a non-spatially-varying calibration.
PhotoCalib(std::shared_ptr< afw::math::BoundedField > calibration, double calibrationErr=0)
Create a spatially-varying calibration.
PhotoCalib()
Create a empty, zeroed calibration.
std::ostream & operator<<(std::ostream &os, VisitInfo const &visitInfo)
double getCalibrationErr() const
Get the mean photometric calibration error.
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
Record class that contains measurements made on a single exposure.
double getInstFluxMag0() const
Get the magnitude zero point (equal to 1 / mean(calibration)).
A CRTP facade class for subclasses of Persistable.