23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H 24 #define LSST_AFW_IMAGE_PHOTOCALIB_H 32 #include "boost/format.hpp" 72 (
boost::format(
"%s must be positive: %.3g") % name % value).str());
139 : _calibrationMean(calibrationMean), _calibrationErr(
calibrationErr), _isConstant(true) {
142 ndarray::Array<double, 2, 2> coeffs = ndarray::allocate(ndarray::makeVector(1, 1));
144 _calibration = std::make_shared<afw::math::ChebyshevBoundedField>(
155 : _calibration(calibration),
156 _calibrationMean(computeCalibrationMean(calibration)),
159 assertNonNegative(_calibrationMean,
"Calibration (computed via BoundedField.mean()) mean");
173 : _calibration(calibration),
174 _calibrationMean(calibrationMean),
175 _calibrationErr(calibrationErr),
176 _isConstant(isConstant) {
194 double instFluxToNanojansky(
double instFlux)
const;
207 Measurement instFluxToNanojansky(
double instFlux,
double instFluxErr,
211 Measurement instFluxToNanojansky(
double instFlux,
double instFluxErr)
const;
272 double instFluxToMagnitude(
double instFlux)
const;
285 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr,
289 Measurement instFluxToMagnitude(
double instFlux,
double instFluxErr)
const;
351 bool includeScaleUncertainty =
true)
const;
390 double magnitudeToInstFlux(
double magnitude)
const;
523 double _calibrationMean;
526 double _calibrationErr;
540 ndarray::Array<double, 1> evaluateArray(ndarray::Array<double, 1>
const &xx,
541 ndarray::Array<double, 1>
const &yy)
const;
553 ndarray::Array<double, 2, 2>
result)
const;
556 ndarray::Array<double, 2, 2> result)
const;
591 #endif // LSST_AFW_IMAGE_PHOTOCALIB_H
def write(self, patchRef, catalog)
Write the output.
std::shared_ptr< PhotoCalib > makePhotoCalibFromMetadata(daf::base::PropertySet &metadata, bool strip=false)
Construct a PhotoCalib from FITS FLUXMAG0/FLUXMAG0ERR keywords.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
std::shared_ptr< PhotoCalib > makePhotoCalibFromCalibZeroPoint(double instFluxMag0, double instFluxMag0Err)
Construct a PhotoCalib from the deprecated Calib-style instFluxMag0/instFluxMag0Err values...
PhotoCalib(double calibrationMean, double calibrationErr, std::shared_ptr< afw::math::BoundedField > calibration, bool isConstant)
Create a calibration with a pre-computed mean.
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
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.
Interface supporting iteration over heterogenous containers.
bool operator!=(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal...
ItemVariant const * other
PhotoCalib(double calibrationMean, double calibrationErr=0, lsst::geom::Box2I const &bbox=lsst::geom::Box2I())
Create a non-spatially-varying calibration.
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.
Utilities for converting between flux and magnitude in C++.
table::Key< double > calibrationMean
PhotoCalib()
Create a empty, zeroed calibration.
Measurement(double value, double error)
double getCalibrationErr() const
Get the mean photometric calibration error.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
Class for storing generic metadata.
Reports invalid arguments.
Record class that contains measurements made on a single exposure.
table::Key< table::Flag > isConstant
void assertNonNegative(double value, std::string const &name)
Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
double getLocalCalibration(lsst::geom::Point< double, 2 > const &point) const
Get the local calibration at a point.
const double referenceFlux
The Oke & Gunn (1983) AB magnitude reference flux, in nJy (often approximated as 3631.0).
A CRTP facade class for subclasses of Persistable.
An integer coordinate rectangle.
double getInstFluxAtZeroMagnitude() const
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude).
table::Key< double > calibrationErr