24 #ifndef LSST_MEAS_BASE_FluxUtilities_h_INCLUDED 25 #define LSST_MEAS_BASE_FluxUtilities_h_INCLUDED 29 #include "lsst/afw/table/FunctorKey.h" 30 #include "lsst/afw/table/Schema.h" 32 namespace lsst {
namespace meas {
namespace base {
46 flux(flux_), fluxSigma(fluxSigma_)
70 afw::table::Schema & schema,
71 std::string
const & name,
72 std::string
const & doc
80 afw::table::Key<meas::base::Flux>
const &
flux,
81 afw::table::Key<FluxErrElement>
const &
fluxSigma 83 _flux(flux), _fluxSigma(fluxSigma)
95 FluxResultKey(afw::table::SubSchema
const & s) : _flux(s[
"flux"]), _fluxSigma(s[
"fluxSigma"]) {}
98 virtual FluxResult get(afw::table::BaseRecord
const & record)
const;
101 virtual void set(afw::table::BaseRecord & record,
FluxResult const & other)
const;
106 return _flux == other._flux && _fluxSigma == other._fluxSigma;
112 bool isValid()
const {
return _flux.isValid() && _fluxSigma.isValid(); }
115 afw::table::Key<meas::base::Flux>
getFlux()
const {
return _flux; }
118 afw::table::Key<FluxErrElement>
getFluxSigma()
const {
return _fluxSigma; }
121 afw::table::Key<Flux> _flux;
122 afw::table::Key<FluxErrElement> _fluxSigma;
149 afw::table::Schema & schema,
150 std::string
const & name
164 MagResultKey(afw::table::SubSchema
const & s) : _magKey(s[
"mag"]), _magErrKey(s[
"magErr"]) {}
167 virtual MagResult get(afw::table::BaseRecord
const & record)
const;
170 virtual void set(afw::table::BaseRecord & record,
MagResult const & magResult)
const;
173 virtual void set(afw::table::BaseRecord & record, std::pair<double,double>
const & magPair)
const;
176 afw::table::Key<Mag> _magKey;
177 afw::table::Key<MagErrElement> _magErrKey;
193 FluxTransform(std::string
const & name, afw::table::SchemaMapper & mapper);
204 virtual void operator()(afw::table::SourceCatalog
const & inputCatalog,
205 afw::table::BaseCatalog & outputCatalog,
206 afw::image::Wcs
const & wcs,
207 afw::image::Calib
const & calib)
const;
224 bool _throwOnNegative;
229 #endif // !LSST_MEAS_BASE_FluxUtilities_h_INCLUDED
MagResultKey(afw::table::SubSchema const &s)
Construct from a subschema, assuming mag and magErr subfields.
afw::table::Key< meas::base::Flux > getFlux() const
Return the underlying flux Key.
FluxResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
A FunctorKey for MagResult.
Temporarily replace negative fluxes with NaNs.
A reusable result struct for magnitudes.
FluxResult()
Default constructor; initializes everything to NaN.
FluxResultKey(afw::table::Key< meas::base::Flux > const &flux, afw::table::Key< FluxErrElement > const &fluxSigma)
Construct from a pair of Keys.
FluxResult(Flux flux_, FluxErrElement fluxSigma_)
Constructor from flux and its uncertainty.
FluxResultKey(afw::table::SubSchema const &s)
Construct from a subschema, assuming flux and fluxSigma subfields.
Flux flux
Measured flux in DN.
bool operator!=(FluxResultKey const &other) const
Compare the FunctorKey for equality with another, using the underlying flux and fluxSigma Keys...
MagResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
A FunctorKey for FluxResult.
bool isValid() const
Return True if both the flux and fluxSigma Keys are valid.
afw::table::Key< FluxErrElement > getFluxSigma() const
Return the underlying fluxSigma Key.
FluxErrElement fluxSigma
1-Sigma error (sqrt of variance) on flux in DN.
A reusable result struct for flux measurements.