23 #ifndef LSST_MEAS_EXTENSIONS_simpleShape_h_INCLUDED 24 #define LSST_MEAS_EXTENSIONS_simpleShape_h_INCLUDED 28 #include "lsst/pex/config.h" 29 #include "lsst/afw/geom/ellipses.h" 30 #include "lsst/afw/table.h" 31 #include "lsst/afw/image.h" 32 #include "lsst/meas/base/Algorithm.h" 33 #include "lsst/meas/base.h" 35 namespace lsst {
namespace meas {
namespace extensions {
namespace simpleShape {
45 LSST_CONTROL_FIELD(
sigma,
double,
"Sigma of circular Gaussian used as weight function, in pixels");
46 LSST_CONTROL_FIELD(
nSigmaRegion,
double,
"Maximum radius for pixels to include, in units of sigma");
54 afw::table::Schema & schema,
55 std::string
const &
name 73 virtual void set(afw::table::BaseRecord & record,
SimpleShapeResult const & value)
const;
84 lsst::meas::base::FlagHandler
const &
getFlagHandler()
const {
return _flagHandler; }
87 lsst::afw::table::QuadrupoleKey _shapeResult;
88 lsst::afw::table::Point2DKey _centroidResult;
89 lsst::afw::table::CovarianceMatrixKey<double, 5 > _uncertantyResult;
90 lsst::meas::base::FlagHandler _flagHandler;
94 class SimpleShape :
public lsst::meas::base::SimpleAlgorithm {
98 static base::FlagDefinitionList
const & getFlagDefinitions();
99 static unsigned int const N_FLAGS = 1;
104 SimpleShape(Control
const & ctrl, std::string
const &
name, afw::table::Schema & schema);
116 template <
typename T>
118 afw::geom::ellipses::Ellipse
const & weight,
119 afw::image::MaskedImage<T>
const & image,
150 static Eigen::Matrix<double,5,6> convertRawMoments(
151 Eigen::Matrix<double,6,1>
const & q,
152 afw::geom::ellipses::Quadrupole & quadrupole,
153 afw::geom::Point2D & center
178 static Eigen::Matrix<double, 5, 5> correctWeightedMoments(
179 afw::geom::ellipses::Quadrupole
const & weight,
180 afw::geom::ellipses::Quadrupole & ellipse,
181 afw::geom::Point2D & center
184 virtual void measure(
185 afw::table::SourceRecord & measRecord,
186 afw::image::Exposure<float>
const & exposure
190 afw::table::SourceRecord & measRecord,
191 lsst::meas::base::MeasurementError * error=NULL
197 lsst::meas::base::SafeCentroidExtractor _centroidExtractor;
210 std::bitset<SimpleShape::N_FLAGS>
flags;
214 bool getFlag(
int index)
const {
return flags[index]; }
222 #endif // !LSST_MEAS_EXTENSIONS_simpleShape_h_INCLUDED Struct to hold the results of SimpleShape when we don't run it as a plugin.
bool operator!=(SimpleShapeResultKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Keys.
Eigen::Matrix< double, 5, 5 > covariance
Matrix of uncertainties; ordered Ixx, Iyy, Ixy, Ix, Iy.
bool getFlag(int index) const
static base::FlagDefinition const FAILURE
A C++ control class to handle SdssShapeAlgorithm's configuration.
std::bitset< SimpleShape::N_FLAGS > flags
double nSigmaRegion
"Maximum radius for pixels to include, in units of sigma" ;
lsst::meas::base::FlagHandler const & getFlagHandler() const
afw::geom::Point2D center
Measured first moments, or the input center if !recentroid.
double sigma
"Sigma of circular Gaussian used as weight function, in pixels" ;
afw::geom::ellipses::Quadrupole ellipse
Measured second moments.
SimpleShapeControl Control