24 #include "lsst/afw/table/Source.h"
28 #include "lsst/afw/detection/Psf.h"
30 namespace lsst {
namespace meas {
namespace base {
34 std::string
const & name,
35 afw::table::Schema & schema
38 FluxResultKey::addFields(schema, name,
"flux derived from PSF-scaled aperture")
47 afw::table::SourceRecord & measRecord,
48 afw::image::Exposure<float>
const & exposure
50 afw::geom::Point2D
const center = _centroidExtractor(measRecord, _flagHandler);
51 double const radius = exposure.getPsf()->computeShape(center).getDeterminantRadius();
52 double const fwhm = 2.0*std::sqrt(2.0*std::log(2))*radius;
53 double const size = _ctrl.
scale*fwhm;
54 afw::geom::ellipses::Axes
const axes(size, size);
62 afw::geom::ellipses::Ellipse(axes, center),
64 measRecord.set(_fluxResultKey, result);
81 std::string
const & name,
82 afw::table::SchemaMapper & mapper
88 afw::table::Key<afw::table::Flag> key = mapper.getInputSchema().find<afw::table::Flag>(name +
"_" + flagName).key;
90 mapper.addMapping(key);
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
static FlagDefinitionList const & getFlagDefinitions()
double scale
"Scaling factor of PSF FWHM for aperture radius." ;
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Configuration object for multiple-aperture flux algorithms.
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ; ...
_centroidExtractor(schema, name)
void setValue(afw::table::BaseRecord &record, std::size_t i, bool value) const
Set the flag field corresponding to the given flag index.
A FunctorKey for FluxResult.
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
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.
bool getFlag(unsigned int index) const
Return the flag value associated with the given bit.
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.
ScaledApertureFluxAlgorithm(Control const &control, std::string const &name, afw::table::Schema &schema)
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" ; ...
std::size_t size() const
return the current size (number of defined elements) of the collection
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.