24 #include "ndarray/eigen.h"
26 #include "lsst/afw/detection/Psf.h"
27 #include "lsst/afw/geom/Box.h"
28 #include "lsst/afw/geom/ellipses/Ellipse.h"
29 #include "lsst/afw/table/Source.h"
33 namespace lsst {
namespace meas {
namespace base {
35 FlagDefinitionList flagDefinitions;
41 return flagDefinitions;
47 std::string
const & name,
48 afw::table::Schema & schema
51 FluxResultKey::addFields(schema, name,
"flux from Gaussian Flux algorithm")
54 _shapeExtractor(schema, name)
60 afw::table::SourceRecord & measRecord,
61 afw::image::Exposure<float>
const & exposure
63 afw::geom::Point2D centroid = _centroidExtractor(measRecord, _flagHandler);
64 afw::geom::ellipses::Quadrupole shape = _shapeExtractor(measRecord, _flagHandler);
67 exposure.getMaskedImage(), shape, centroid
70 measRecord.set(_fluxResultKey, result);
A C++ control class to handle GaussianFluxAlgorithm's configuration.
static FluxResult computeFixedMomentsFlux(ImageT const &image, afw::geom::ellipses::Quadrupole const &shape, afw::geom::Point2D const &position)
Compute the flux within a fixed Gaussian aperture.
static FlagDefinitionList const & getFlagDefinitions()
virtual void fail(afw::table::SourceRecord &measRecord, MeasurementError *error=nullptr) const
Handle an exception thrown by the current algorithm by setting flags in the given record...
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Called to measure a single child source in an image.
GaussianFluxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
Exception to be thrown when a measurement algorithm experiences a known failure mode.
_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.
static FlagDefinition const FAILURE
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.
vector-type utility class to build a collection of FlagDefinitions
A reusable result struct for flux measurements.