24 #ifndef LSST_MEAS_BASE_SdssShape_h_INCLUDED 25 #define LSST_MEAS_BASE_SdssShape_h_INCLUDED 29 #include "lsst/pex/config.h" 30 #include "lsst/afw/image/Exposure.h" 31 #include "lsst/afw/geom/ellipses/Quadrupole.h" 32 #include "lsst/afw/table/aggregates.h" 43 class SdssShapeResult;
52 LSST_CONTROL_FIELD(
background,
double,
"Additional value to add to background");
53 LSST_CONTROL_FIELD(
maxIter,
int,
"Maximum number of iterations");
54 LSST_CONTROL_FIELD(
maxShift,
double,
"Maximum centroid shift, limited to 2-10");
55 LSST_CONTROL_FIELD(
tol1,
float,
"Convergence tolerance for e1,e2");
56 LSST_CONTROL_FIELD(
tol2,
float,
"Convergence tolerance for FWHM");
57 LSST_CONTROL_FIELD(
doMeasurePsf,
bool,
"Whether to also compute the shape of the PSF model");
86 afw::table::Schema & schema,
87 std::string
const & name,
106 virtual SdssShapeResult get(afw::table::BaseRecord
const & record)
const;
109 virtual void set(afw::table::BaseRecord & record,
SdssShapeResult const & value)
const;
112 virtual afw::geom::ellipses::Quadrupole getPsfShape(afw::table::BaseRecord
const & record)
const;
115 virtual void setPsfShape(afw::table::BaseRecord & record,
116 afw::geom::ellipses::Quadrupole
const & value)
const;
125 bool isValid()
const;
134 afw::table::QuadrupoleKey _psfShapeResult;
135 afw::table::Key<ErrElement> _flux_xx_Cov;
136 afw::table::Key<ErrElement> _flux_yy_Cov;
137 afw::table::Key<ErrElement> _flux_xy_Cov;
157 static unsigned int const N_FLAGS = 6;
174 SdssShapeAlgorithm(Control
const & ctrl, std::string
const & name, afw::table::Schema & schema);
186 template <
typename ImageT>
187 static Result computeAdaptiveMoments(
188 ImageT
const & image,
189 afw::geom::Point2D
const & position,
203 template <
typename ImageT>
205 ImageT
const & image,
206 afw::geom::ellipses::Quadrupole
const & shape,
207 afw::geom::Point2D
const & position
210 virtual void measure(
211 afw::table::SourceRecord & measRecord,
212 afw::image::Exposure<float>
const & exposure
216 afw::table::SourceRecord & measRecord,
222 ResultKey _resultKey;
244 std::bitset<SdssShapeAlgorithm::N_FLAGS>
flags;
248 bool getFlag(
unsigned int index)
const {
return flags[index]; }
250 bool getFlag(std::string
const & name)
const {
269 SdssShapeTransform(Control
const & ctrl, std::string
const & name, afw::table::SchemaMapper & mapper);
280 virtual void operator()(afw::table::SourceCatalog
const & inputCatalog,
281 afw::table::BaseCatalog & outputCatalog,
282 afw::image::Wcs
const & wcs,
283 afw::image::Calib
const & calib)
const;
288 afw::table::QuadrupoleKey _outPsfShapeKey;
294 #endif // !LSST_MEAS_BASE_SdssShape_h_INCLUDED
bool doMeasurePsf
"Whether to also compute the shape of the PSF model" ;
float tol2
"Convergence tolerance for FWHM" ;
static FlagDefinition const SHIFT
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
A reusable struct for centroid measurements.
bool operator!=(SdssShapeResultKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Keys.
double background
"Additional value to add to background" ;
int maxIter
"Maximum number of iterations" ;
Exception to be thrown when a measurement algorithm experiences a known failure mode.
static FlagDefinition const UNWEIGHTED
float tol1
"Convergence tolerance for e1,e2" ;
static FlagDefinition const UNWEIGHTED_BAD
double maxShift
"Maximum centroid shift, limited to 2-10" ;
ErrElement flux_yy_Cov
flux, yy term in the uncertainty covariance matrix
A FunctorKey for ShapeResult.
bool getFlag(std::string const &name) const
Utility class for handling flag fields that indicate the failure modes of an algorithm.
A reusable struct for moments-based shape measurements.
Result object SdssShapeAlgorithm.
static FlagDefinitionList const & getFlagDefinitions()
FlagDefinition getDefinition(std::size_t index) const
get a reference to the FlagDefinition with specified index.
A C++ control class to handle SdssShapeAlgorithm's configuration.
A FunctorKey for FluxResult.
std::bitset< SdssShapeAlgorithm::N_FLAGS > flags
Status flags (see SdssShapeAlgorithm).
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
static FlagDefinition const MAXITER
static FlagDefinition const PSF_SHAPE_BAD
A FunctorKey that maps SdssShapeResult to afw::table Records.
static FlagDefinition const FAILURE
SdssShapeResultKey ResultKey
A FunctorKey for CentroidResult.
Measure the image moments of source using adaptive Gaussian weights.
SdssShapeResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
FlagHandler const & getFlagHandler() const
vector-type utility class to build a collection of FlagDefinitions
ErrElement flux_xx_Cov
flux, xx term in the uncertainty covariance matrix
bool getFlag(unsigned int index) const
Flag getter for Swig, which doesn't understand std::bitset.
A reusable result struct for flux measurements.
ErrElement flux_xy_Cov
flux, xy term in the uncertainty covariance matrix