29 #ifndef LSST_AFW_IMAGE_CALIB_H 30 #define LSST_AFW_IMAGE_CALIB_H 35 #include "ndarray_fwd.h" 50 namespace cameraGeom {
55 static double const JanskysPerABFlux = 3631.0;
62 return std::abs(fluxErr / (-0.4 * flux *
std::log(10)));
75 ndarray::Array<T, 1>
abMagFromFlux(ndarray::Array<T const, 1>
const& flux);
80 ndarray::Array<T const, 1>
const& flux);
84 ndarray::Array<T, 1>
fluxFromABMag(ndarray::Array<T const, 1>
const& mag);
89 ndarray::Array<T const, 1>
const& mag);
100 explicit Calib() noexcept;
122 ~
Calib() noexcept
override;
130 void setFluxMag0(
double fluxMag0,
double fluxMag0Err = 0.0);
145 double getFlux(
double const mag)
const;
157 ndarray::Array<double, 1> getFlux(ndarray::Array<double const, 1>
const& mag)
const;
160 ndarray::Array<double const, 1>
const& mag, ndarray::Array<double const, 1>
const& magErr)
const;
167 double getMagnitude(
double const flux)
const;
177 ndarray::Array<double, 1> getMagnitude(ndarray::Array<double const, 1>
const& flux)
const;
180 ndarray::Array<double const, 1>
const& flux,
181 ndarray::Array<double const, 1>
const& fluxErr)
const;
188 static void setThrowOnNegativeFlux(
bool raiseException) noexcept;
192 static bool getThrowOnNegativeFlux() noexcept;
198 bool operator==(
Calib const& rhs)
const noexcept;
206 (*this) *= 1.0 /
scale;
223 static bool _throwOnNegativeFlux;
248 #endif // LSST_AFW_IMAGE_CALIB_H ndarray::Array< T, 1 > fluxFromABMag(ndarray::Array< T const, 1 > const &mag)
Compute flux in Janskys from AB magnitude.
Calib & operator/=(double const scale)
An object passed to Persistable::write to allow it to persist itself.
void operator*=(ExtentBase< int, N > &lhs, double rhs) noexcept
def scale(algorithm, min, max=None, frame=None)
bool operator!=(Calib const &rhs) const noexcept
std::size_t hash_value(Extent< T, N > const &extent) noexcept
Describe an exposure's calibration.
A base class for objects that can be persisted via afw::table::io Archive classes.
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
A base class for image defects.
int stripCalibKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Calib-related keywords from the metadata.
table::Key< double > fluxMag0Err
ndarray::Array< T, 1 > abMagFromFlux(ndarray::Array< T const, 1 > const &flux)
Compute AB magnitude from flux in Janskys.
ndarray::Array< T, 1 > abMagErrFromFluxErr(ndarray::Array< T const, 1 > const &fluxErr, ndarray::Array< T const, 1 > const &flux)
Compute AB magnitude error from flux and flux error in Janskys.
table::Key< double > fluxMag0
ndarray::Array< T, 1 > fluxErrFromABMagErr(ndarray::Array< T const, 1 > const &magErr, ndarray::Array< T const, 1 > const &mag)
Compute flux error in Janskys from AB magnitude error and AB magnitude.
A CRTP facade class for subclasses of Persistable.
size_t operator()(argument_type const &obj) const noexcept