LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H
24 #define LSST_AFW_IMAGE_PHOTOCALIB_H
32 #include "boost/format.hpp"
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),
351 bool includeScaleUncertainty =
true)
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
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
const double referenceFlux
The Oke & Gunn (1983) AB magnitude reference flux, in nJy (often approximated as 3631....
Utilities for converting between flux and magnitude in C++.
std::shared_ptr< PhotoCalib > makePhotoCalibFromMetadata(daf::base::PropertySet &metadata, bool strip=false)
Construct a PhotoCalib from FITS FLUXMAG0/FLUXMAG0ERR keywords.
Record class that contains measurements made on a single exposure.
PhotoCalib(std::shared_ptr< afw::math::BoundedField > calibration, double calibrationErr=0)
Create a spatially-varying calibration.
PhotoCalib(PhotoCalib &&)=default
table::Key< double > calibrationErr
PhotoCalib()
Create a empty, zeroed calibration.
table::Key< double > calibrationMean
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
table::Key< table::Flag > isConstant
double instFluxToMagnitude(double instFlux, lsst::geom::Point< double, 2 > const &point) const
Convert instFlux in ADU to AB magnitude.
double getLocalCalibration(lsst::geom::Point< double, 2 > const &point) const
Get the local calibration at a point.
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
double getCalibrationMean() const
Get the mean photometric calibration.
std::shared_ptr< PhotoCalib > makePhotoCalibFromCalibZeroPoint(double instFluxMag0, double instFluxMag0Err)
Construct a PhotoCalib from the deprecated Calib-style instFluxMag0/instFluxMag0Err values.
double getInstFluxAtZeroMagnitude() const
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude).
Interface supporting iteration over heterogenous containers.
afw::table::SourceCatalog calibrateCatalog(afw::table::SourceCatalog const &catalog, std::vector< std::string > const &instFluxFields) const
Return a flux calibrated catalog, with new _flux, _fluxErr, _mag, and _magErr fields.
bool operator==(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal.
PhotoCalib & operator=(PhotoCalib const &)=delete
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
PhotoCalib(PhotoCalib const &)=default
std::shared_ptr< afw::math::BoundedField > computeScalingTo(std::shared_ptr< PhotoCalib > other) const
Calculates the scaling between this PhotoCalib and another PhotoCalib.
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new PhotoCalib that is a copy of this one.
A class to manipulate images, masks, and variance as a single object.
double instFluxToNanojansky(double instFlux, lsst::geom::Point< double, 2 > const &point) const
Convert instFlux in ADU to nJy at a point in the BoundedField.
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
PhotoCalib & operator=(PhotoCalib &&)=delete
ItemVariant const * other
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
The photometric calibration of an exposure.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
std::string toString() const override
Create a string representation of this object.
PhotoCalib(double calibrationMean, double calibrationErr, std::shared_ptr< afw::math::BoundedField > calibration, bool isConstant)
Create a calibration with a pre-computed mean.
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Reports invalid arguments.
bool operator!=(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal.
A CRTP facade class for subclasses of Persistable.
Class for storing generic metadata.
void assertNonNegative(double value, std::string const &name)
Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0.
An integer coordinate rectangle.
PhotoCalib(double calibrationMean, double calibrationErr=0, lsst::geom::Box2I const &bbox=lsst::geom::Box2I())
Create a non-spatially-varying calibration.
Measurement(double value, double error)
std::shared_ptr< afw::math::BoundedField > computeScaledCalibration() const
Calculates the spatially-variable calibration, normalized by the mean in the valid domain.
MaskedImage< float > calibrateImage(MaskedImage< float > const &maskedImage, bool includeScaleUncertainty=true) const
Return a flux calibrated image, with pixel values in nJy.
~PhotoCalib() override=default
double getCalibrationErr() const
Get the mean photometric calibration error.
double magnitudeToInstFlux(double magnitude, lsst::geom::Point< double, 2 > const &point) const
Convert AB magnitude to instFlux (ADU).
io::OutputArchiveHandle OutputArchiveHandle
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.