23 #ifndef LSST_AFW_IMAGE_PHOTOCALIB_H
24 #define LSST_AFW_IMAGE_PHOTOCALIB_H
105 : _instFluxMag0(instFluxMag0), _instFluxMag0Err(
instFluxMag0Err), _isConstant(true) {
106 ndarray::Array<double, 2, 2> coeffs = ndarray::allocate(ndarray::makeVector(1, 1));
108 _zeroPoint = std::make_shared<afw::math::ChebyshevBoundedField>(
119 : _zeroPoint(zeroPoint),
120 _instFluxMag0(computeInstFluxMag0(zeroPoint)),
122 _isConstant(false) {}
133 std::shared_ptr<afw::math::BoundedField> zeroPoint,
bool isConstant)
134 : _zeroPoint(zeroPoint),
135 _instFluxMag0(instFluxMag0),
136 _instFluxMag0Err(instFluxMag0Err),
137 _isConstant(isConstant) {}
184 std::string
const &instFluxField)
const;
199 std::string
const &instFluxField)
const;
217 std::string
const &outField)
const;
264 std::string
const &instFluxField)
const;
279 std::string
const &instFluxField)
const;
298 std::string
const &outField)
const;
364 std::shared_ptr<afw::math::BoundedField>
computeScalingTo(std::shared_ptr<PhotoCalib> other)
const;
382 std::shared_ptr<afw::math::BoundedField> _zeroPoint;
387 double _instFluxMag0;
390 double _instFluxMag0Err;
396 double computeInstFluxMag0(std::shared_ptr<afw::math::BoundedField> zeroPoint)
const;
400 std::string
const &instFluxField, ndarray::Array<double, 2, 2>
result)
const;
402 std::string
const &instFluxField,
403 ndarray::Array<double, 2, 2>
result)
const;
409 #endif // LSST_AFW_IMAGE_PHOTOCALIB_H
table::Key< double > instFluxMag0Err
bool operator==(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal...
double getInstFluxMag0Err() const
Get the mean instFlux/magnitude zero point error.
PhotoCalib(double instFluxMag0, double instFluxMag0Err, std::shared_ptr< afw::math::BoundedField > zeroPoint, bool isConstant)
Create a calibration with a pre-computed mean.
The photometric calibration of an exposure.
double getInstFluxMag0() const
Get the mean instFlux/magnitude zero point.
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
An integer coordinate rectangle.
A base class for objects that can be persisted via afw::table::io Archive classes.
table::Key< double > instFluxMag0
Measurement(double value, double err)
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
std::shared_ptr< afw::math::BoundedField > computeScaledZeroPoint() const
Calculates the spatially-variable zero point, normalized by the mean in the valid domain...
double magnitudeToInstFlux(double magnitude) const
Convert AB magnitude to instFlux (ADU), using the mean instFlux/magnitude scaling factor...
PhotoCalib()
Create a empty, zeroed calibration.
double instFluxToMagnitude(double instFlux, afw::geom::Point< double, 2 > const &point) const
Convert instFlux in ADU to AB magnitude.
PhotoCalib(double instFluxMag0, double instFluxMag0Err=0, afw::geom::Box2I const &bbox=afw::geom::Box2I())
Create a non-spatially-varying calibration.
PhotoCalib(std::shared_ptr< afw::math::BoundedField > zeroPoint, double instFluxMag0Err=0)
Create a spatially-varying calibration.
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
friend std::ostream & operator<<(std::ostream &os, PhotoCalib const &photoCalib)
PhotoCalib & operator=(PhotoCalib const &)=delete
bool operator!=(PhotoCalib const &rhs) const
Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal...
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
std::shared_ptr< afw::math::BoundedField > computeScalingTo(std::shared_ptr< PhotoCalib > other) const
Calculates the scaling between this PhotoCalib and another PhotoCalib.
double instFluxToMaggies(double instFlux, afw::geom::Point< double, 2 > const &point) const
Convert instFlux in ADU to maggies at a point in the BoundedField.
io::OutputArchiveHandle OutputArchiveHandle
Record class that contains measurements made on a single exposure.
table::Key< table::Flag > isConstant
A CRTP facade class for subclasses of Persistable.