25 #ifndef LSST_IP_DIFFIM_DIPOLEALGORITHMS_H
26 #define LSST_IP_DIFFIM_DIPOLEALGORITHMS_H
40 #include "ndarray/eigen.h"
103 std::string
const & doc,
ResultKey const & positiveKeys,
ResultKey const & negativeKeys);
130 std::string
const & doc);
158 static std::array<meas::base::FlagDefinition,N_FLAGS>
const flagDefs = {{
159 {
"flag",
"general failure flag, set if anything went wrong"},
160 {
"pos_flag",
"failure flag for positive, set if anything went wrong"},
161 {
"neg_flag",
"failure flag for negative, set if anything went wrong"}
181 static std::array<meas::base::FlagDefinition,N_FLAGS>
const flagDefs = {{
182 {
"flag",
"general failure flag, set if anything went wrong"},
183 {
"pos_flag",
"failure flag for positive, set if anything went wrong"},
184 {
"neg_flag",
"failure flag for negative, set if anything went wrong"}
194 std::string
const & doc,
ResultKey const & positiveKeys,
ResultKey const & negativeKeys
198 static std::array<meas::base::FlagDefinition,N_FLAGS>
const flagDefs = {{
199 {
"flag",
"general failure flag, set if anything went wrong"},
200 {
"pos_flag",
"failure flag for positive, set if anything went wrong"},
201 {
"neg_flag",
"failure flag for negative, set if anything went wrong"}
212 std::string
const & doc
216 static std::array<meas::base::FlagDefinition,N_FLAGS>
const flagDefs = {{
217 {
"flag",
"general failure flag, set if anything went wrong"},
218 {
"pos_flag",
"failure flag for positive, set if anything went wrong"},
219 {
"neg_flag",
"failure flag for negative, set if anything went wrong"}
239 _numPositiveKey(schema.addField<int>(name+
"_npos",
"number of positive pixels",
"count")),
240 _numNegativeKey(schema.addField<int>(name+
"_nneg",
"number of negative pixels",
"count"))
324 _chi2dofKey(schema.addField<float>(name+
"_chi2dof",
325 "chi2 per degree of freedom of fit"))
336 double negCenterX,
double negCenterY,
double negFlux,
337 double posCenterX,
double poCenterY,
double posFlux
362 #endif // !LSST_IP_DIFFIM_DIPOLEALGORITHMS_H
Defines the fields and offsets for a table.
afw::table::Key< float > _chi2dofKey
meas::base::FluxResultKey _fluxResultKey
float stepSizeFlux
"Default initial step size for flux in non-linear fitter" ;
meas::base::CentroidResultKey _avgCentroid
meas::base::CentroidResultKey ResultKey
DipoleFluxControl Control
A typedef to the Control object for this algorithm, defined above.
Implementation of Psf dipole flux.
table::Key< std::string > name
void mergeCentroids(afw::table::SourceRecord &source, double posValue, double negValue) const
meas::base::FluxResultKey _fluxResultKey
Intermediate base class for algorithms that compute a centroid.
afw::table::Key< int > _numNegativeKey
ResultKey const & getCenterKeys() const
Return the standard centroid keys registered by this algorithm.
afw::table::Schema schema
meas::base::FluxResultKey ResultKey
NaiveDipoleFlux(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
Only the diagonal elements of the covariance matrix are provided.
meas::base::FluxResultKey _fluxResultKey
void fail(afw::table::SourceRecord &measRecord, meas::base::MeasurementError *error=NULL) const
Handle an exception thrown by the current algorithm by setting flags in the given record...
meas::base::CentroidResultKey _negCentroid
C++ control object for PSF dipole fluxes.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
A preprocessor macro used to define fields in C++ "control object" structs.
ResultKey const & getPositiveKeys() const
Return the standard flux keys registered by this algorithm.
static FluxResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
Add a pair of _flux, _fluxSigma fields to a Schema, and return a FluxResultKey that points to them...
ResultKey const & getNegativeKeys() const
void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Given an image and a pixel position, return a Centroid using a naive 3x3 weighted moment...
DipoleFluxControl Control
meas::base::CentroidResultKey _posCentroid
ResultKey const & getNegativeKeys() const
Utility class for handling flag fields that indicate the failure modes of an algorithm.
meas::base::FlagHandler _flagHandler
void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Called to measure a single child source in an image.
DipoleCentroidAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, std::string const &doc)
meas::base::FlagHandler _flagHandler
ResultKey const & getNegativeKeys() const
static CentroidResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty)
Add the appropriate fields to a Schema, and return a CentroidResultKey that manages them...
NaiveDipoleCentroid(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
double errorDef
"How many sigma the error bars of the non-linear fitter represent" ;
Intermediate base class for algorithms that compute a flux.
void fail(afw::table::SourceRecord &measRecord, meas::base::MeasurementError *error=NULL) const
Handle an exception thrown by the current algorithm by setting flags in the given record...
A FunctorKey for FluxResult.
Intermediate base class for algorithms that compute a centroid.
int maxFnCalls
"Maximum function calls for non-linear fitter; 0 = unlimited" ;
void fail(afw::table::SourceRecord &measRecord, meas::base::MeasurementError *error=NULL) const
Handle an exception thrown by the current algorithm by setting flags in the given record...
DipoleCentroidControl Control
DipoleFluxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, std::string const &doc)
meas::base::FlagHandler _flagHandler
meas::base::CentroidResultKey ResultKey
Tuple type that holds the keys that define a standard centroid algorithm.
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
float stepSizeCoord
"Default initial step size for coordinates in non-linear fitter" ;
std::pair< double, int > chi2(afw::table::SourceRecord &source, afw::image::Exposure< float > const &exposure, double negCenterX, double negCenterY, double negFlux, double posCenterX, double poCenterY, double posFlux) const
ResultKey const & getPositiveKeys() const
A FunctorKey for CentroidResult.
ResultKey const & getPositiveKeys() const
Return the standard centroid keys registered by this algorithm.
Record class that contains measurements made on a single exposure.
afw::table::Key< int > _numPositiveKey
PsfDipoleFlux(PsfDipoleFluxControl const &ctrl, std::string const &name, afw::table::Schema &schema)
static FlagHandler addFields(afw::table::Schema &schema, std::string const &prefix, FlagDefinition const *begin, FlagDefinition const *end)
Add Flag fields to a schema, creating a FlagHandler object to manage them.
void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Given an image and a pixel position, return a Centroid using a naive 3x3 weighted moment...
PsfDipoleFluxControl Control