38FlagDefinitionList flagDefinitions;
43 flagDefinitions.add(
"flag_noGoodPixels",
"no good pixels in the annulus");
54 _stats(ctrl.bgRej, ctrl.bgIter) {
60 geom::Point2D const center = _centroidExtractor(measRecord, _flagHandler);
72 float const psfSigma =
psf->computeShape(center).getDeterminantRadius();
82 auto const& annulus = outer->clippedTo(
image.getBBox())->intersectNot(*inner);
83 auto const& imageValues = annulus->flatten(
image.getImage()->getArray(),
image.getXY0());
84 auto const& maskValues = annulus->flatten(
image.getMask()->getArray(),
image.getXY0());
88 values.
reserve(imageValues.getNumElements());
89 if(imageValues.getNumElements() != maskValues.getNumElements()) {
92 auto maskIter = maskValues.begin();
93 for (
auto imageIter = imageValues.begin(); imageIter != imageValues.end(); ++imageIter, ++maskIter) {
94 if ((*maskIter & badMask) == 0) {
99 if (values.
size() == 0) {
121 if (
mapper.getInputSchema().getNames().count(
mapper.getInputSchema().join(
name, flag.
name)) == 0)
124 mapper.getInputSchema().find<afw::table::Flag>(
name +
"_" + flag.
name).key;
table::Key< std::string > name
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
LSST DM logging module built on log4cxx.
static std::shared_ptr< geom::SpanSet > fromShape(int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I())
Factory function for creating SpanSets from a Stencil.
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
An ellipse defined by an arbitrary BaseCore and a center point.
A class to contain the data, WCS, and other information needed to describe an image of the sky.
Represent a 2-dimensional array of bitmask pixels.
A class to manipulate images, masks, and variance as a single object.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
A class used as a handle to a particular field in a table.
Defines the fields and offsets for a table.
A mapping between the keys of two Schemas, used to copy data between them.
Record class that contains measurements made on a single exposure.
vector-type utility class to build a collection of FlagDefinitions
std::size_t size() const
return the current size (number of defined elements) of the collection
Utility class for handling flag fields that indicate the failure modes of an algorithm.
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
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.
LocalBackgroundAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, std::string const &logName="")
static FlagDefinition const FAILURE
static FlagDefinition const NO_PSF
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Called to measure a single child source in an image.
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.
static FlagDefinitionList const & getFlagDefinitions()
static FlagDefinition const NO_GOOD_PIXELS
Configuration of LocalBackgroundAlgorithm.
std::vector< std::string > badMaskPlanes
"Mask planes that indicate pixels that should be excluded from the measurement" ;
float annulusInner
"Inner radius for background annulus as a multiple of the PSF sigma" ;
float annulusOuter
"Outer radius for background annulus as a multiple of the PSF sigma" ;
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Reports attempts to exceed implementation-defined length limits for some classes.
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
@ STDEVCLIP
estimate sample N-sigma clipped stdev (N set in StatisticsControl, default=3)
@ MEANCLIP
estimate sample N-sigma clipped mean (N set in StatisticsControl, default=3)
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
A reusable result struct for instFlux measurements.