38 FluxResultKey::addFields(schema, name,
"instFlux derived from PSF-scaled aperture")),
39 _centroidExtractor(schema, name) {
45 geom::Point2D const center = _centroidExtractor(measRecord, _flagHandler);
46 double const radius = exposure.
getPsf()->computeShape(center).getDeterminantRadius();
48 double const size = _ctrl.
scale * fwhm;
58 measRecord.
set(_instFluxResultKey, result);
78 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
Defines the fields and offsets for a table.
bool getFlag(unsigned int index) const
Return the flag value associated with the given bit.
static FlagDefinitionList const & getFlagDefinitions()
A mapping between the keys of two Schemas, used to copy data between them.
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
Return true if the key was initialized to valid offset.
Configuration object for multiple-aperture flux algorithms.
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ; ...
A base class for image defects.
MaskedImageT getMaskedImage()
Return the MaskedImage.
An ellipse defined by an arbitrary BaseCore and a center point.
A FunctorKey for FluxResult.
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.
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a...
std::shared_ptr< lsst::afw::detection::Psf > getPsf()
Return the Exposure's Psf object.
static Result computeSincFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the instFlux (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)
Set value of a field for the given key.
Record class that contains measurements made on a single exposure.
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 instFlux on the given image.
A Result struct for running an aperture flux algorithm with a single radius.