lsst.meas.base
tickets.DM-23835-g914efbff1e
|
Go to the documentation of this file.
38 FlagDefinitionList 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);
70 float const psfSigma =
psf->computeShape().getDeterminantRadius();
80 auto const& annulus = outer->clippedTo(
image.getBBox())->intersectNot(*inner);
81 auto const& imageValues = annulus->flatten(
image.getImage()->getArray(),
image.getXY0());
82 auto const& maskValues = annulus->flatten(
image.getMask()->getArray(),
image.getXY0());
86 values.
reserve(imageValues.getNumElements());
87 assert(imageValues.getNumElements() == maskValues.getNumElements());
88 auto maskIter = maskValues.begin();
89 for (
auto imageIter = imageValues.begin(); imageIter != imageValues.end(); ++imageIter, ++maskIter) {
90 if ((*maskIter & badMask) == 0) {
95 if (values.
size() == 0) {
115 if (
mapper.getInputSchema().getNames().count(
mapper.getInputSchema().join(name, flag.
name)) == 0)
118 mapper.getInputSchema().find<afw::table::Flag>(
name +
"_" + flag.
name).key;
std::shared_ptr< lsst::afw::detection::Psf const > getPsf() const
A reusable result struct for instFlux measurements.
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Called to measure a single child source in an image.
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
std::vector< std::string > badMaskPlanes
"Mask planes that indicate pixels that should be excluded from the measurement" ;
LocalBackgroundAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, std::string const &logName="")
static const FlagDefinition NO_GOOD_PIXELS
static FlagDefinitionList const & getFlagDefinitions()
Exception to be thrown when a measurement algorithm experiences a known failure mode.
A FunctorKey for FluxResult.
MaskedImageT getMaskedImage()
vector-type utility class to build a collection of FlagDefinitions
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
static const FlagDefinition NO_PSF
static const FlagDefinition FAILURE
std::unique_ptr< SchemaItem< U > > result
Utility class for handling flag fields that indicate the failure modes of an algorithm.
#define LSST_EXCEPT(type,...)
std::size_t size() const
return the current size (number of defined elements) of the collection
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
static std::shared_ptr< geom::SpanSet > fromShape(int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I())
Configuration of LocalBackgroundAlgorithm.
void set(Key< T > const &key, U const &value)
float annulusOuter
"Outer radius for background annulus as a multiple of the PSF sigma" ;
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.
float annulusInner
"Inner radius for background annulus as a multiple of the PSF sigma" ;