37 _fluxResultKey(
FluxResultKey::addFields(schema, name,
"flux derived from PSF-scaled aperture")),
38 _centroidExtractor(schema, name) {
44 geom::Point2D const center = _centroidExtractor(measRecord, _flagHandler);
45 double const radius = exposure.
getPsf()->computeShape(center).getDeterminantRadius();
47 double const size = _ctrl.
scale * fwhm;
57 measRecord.
set(_fluxResultKey, result);
77 mapper.getInputSchema().find<afw::table::Flag>(
name +
"_" + flagName).key;
std::size_t size() const
return the current size (number of defined elements) of the collection
bool getFlag(unsigned int index) const
Return the flag value associated with the given bit.
static FlagDefinitionList const & getFlagDefinitions()
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
double scale
"Scaling factor of PSF FWHM for aperture radius." ;
void setValue(afw::table::BaseRecord &record, std::size_t i, bool value) const
Set the flag field corresponding to the given flag index.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
bool isValid() const noexcept
Configuration object for multiple-aperture flux algorithms.
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ; ...
MaskedImageT getMaskedImage()
A FunctorKey for FluxResult.
std::unique_ptr< SchemaItem< U > > result
static FlagHandler addFields(afw::table::Schema &schema, std::string const &prefix, FlagDefinitionList const &flagDefs, FlagDefinitionList const &exclDefs=FlagDefinitionList::getEmptyList())
Add Flag fields to a schema, creating a FlagHandler object to manage them.
std::shared_ptr< lsst::afw::detection::Psf > getPsf()
static Result computeSincFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the flux (and optionally, uncertanties) within an aperture using Sinc photometry.
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
ScaledApertureFluxAlgorithm(Control const &control, std::string const &name, afw::table::Schema &schema)
void set(Key< T > const &key, U const &value)
virtual void fail(afw::table::SourceRecord &measRecord, MeasurementError *error=nullptr) const override
Handle an exception thrown by the current algorithm by setting flags in the given record...
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ; ...
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const override
Measure the scaled aperture flux on the given image.
A Result struct for running an aperture flux algorithm with a single radius.