24#include "ndarray/eigen.h"
40FlagDefinitionList flagDefinitions;
79 double computeGaussianWidth(Method how = ADAPTIVE_MOMENT)
const;
80 double computeEffectiveArea()
const;
100PsfAttributes::PsfAttributes(
105 _psfImage(
psf->computeImage(geom::
PointD(cen))) {}
111double PsfAttributes::computeEffectiveArea()
const {
114 for (
int iY = 0; iY != _psfImage->getHeight(); ++iY) {
118 sumsqr += (*ptr) * (*ptr);
121 return sum * sum / sumsqr;
147 os <<
"fracShift = " <<
fracShift <<
" too large; abs value must be < 1 in both axes";
162 os <<
"Warping kernel extends off the edge"
174 typename MaskedImageT::const_xy_locator
const mimageLoc =
176 return afw::math::convolveAtAPoint<MaskedImageT, MaskedImageT>(
212 os <<
"Center = " << center <<
" not in exposure bbox" <<
mimage.getBBox();
239 result.instFlux = instFlux;
table::Key< std::string > name
#define LSST_EXCEPT(type,...)
typename _view_t::x_iterator x_iterator
bool contains(Point2D const &point) const noexcept
vector-type utility class to build a collection of FlagDefinitions
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.
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.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
PeakLikelihoodFluxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
static FlagDefinitionList const & getFlagDefinitions()
static FlagDefinition const FAILURE
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.
C++ control object for peak likelihood instrument flux.
std::string warpingKernelName
"Name of warping kernel (e.g. \"lanczos4\") used to compute the peak" ;
double indexToPosition(double ind)
int positionToIndex(double pos)
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
afw::image::MaskedImage< T >::SinglePixel computeShiftedValue(afw::image::MaskedImage< T > const &maskedImage, std::string const &warpingKernelName, geom::Point2D const &fracShift, geom::Point2I const &parentInd)
Compute the value of one pixel of an image after a fractional pixel shift Since we only want the valu...
A reusable result struct for instFlux measurements.