26 namespace lsst {
namespace meas {
namespace base {
32 xxSigma(std::numeric_limits<
ErrElement>::quiet_NaN()),
33 yySigma(std::numeric_limits<
ErrElement>::quiet_NaN()),
34 xySigma(std::numeric_limits<
ErrElement>::quiet_NaN()),
35 xx_yy_Cov(std::numeric_limits<
ErrElement>::quiet_NaN()),
36 xx_xy_Cov(std::numeric_limits<
ErrElement>::quiet_NaN()),
37 yy_xy_Cov(std::numeric_limits<
ErrElement>::quiet_NaN())
58 xxSigma = std::sqrt(matrix(0, 0));
59 yySigma = std::sqrt(matrix(1, 1));
60 xySigma = std::sqrt(matrix(2, 2));
77 std::string
const &
name,
78 std::string
const & doc,
90 std::vector< afw::table::Key<ErrElement> >
sigma(3);
91 std::vector< afw::table::Key<ErrElement> > cov;
93 schema.
join(name,
"xxSigma"),
"1-sigma uncertainty on xx moment",
97 schema.
join(name,
"yySigma"),
"1-sigma uncertainty on yy moment",
101 schema.
join(name,
"xySigma"),
"1-sigma uncertainty on xy moment",
107 schema.
join(name,
"xx_yy_Cov"),
"uncertainty covariance in xx and yy",
113 schema.
join(name,
"xx_xy_Cov"),
"uncertainty covariance in xx and xy",
119 schema.
join(name,
"yy_xy_Cov"),
"uncertainty covariance in yy and xy",
131 std::vector<std::string> getNameVector() {
132 std::vector<std::string> v;
144 static std::vector<std::string> names = getNameVector();
147 }
catch (pex::exceptions::NotFoundError &) {}
168 Eigen::Matrix<ShapeElement,3,3,Eigen::DontAlign>
m;
169 m << xform[LT::XX]*xform[LT::XX], xform[LT::XY]*xform[LT::XY], 2*xform[LT::XX]*xform[LT::XY],
170 xform[LT::YX]*xform[LT::YX], xform[LT::YY]*xform[LT::YY], 2*xform[LT::YX]*xform[LT::YY],
171 xform[LT::XX]*xform[LT::YX], xform[LT::XY]*xform[LT::YY],
172 xform[LT::XX]*xform[LT::YY] + xform[LT::XY]*xform[LT::YX];
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
A proxy type for name lookups in a Schema.
ShapeTrMatrix makeShapeTransformMatrix(afw::geom::LinearTransform const &xform)
Construct a matrix suitable for transforming second moments.
ErrElement yy_xy_Cov
yy,xy term in the uncertainty convariance matrix
table::Key< std::string > name
Eigen::Matrix< ErrElement, 3, 3, Eigen::DontAlign > ShapeCov
UncertaintyEnum
An enum used to specify how much uncertainty information measurement algorithms provide.
afw::table::Schema schema
ShapeResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
double const getIxy() const
The full covariance matrix is provided.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
ErrElement xySigma
1-Sigma uncertainty on xy (sqrt of variance)
Shape const getShape() const
Return an afw::geom::ellipses object corresponding to xx, yy, xy.
afw::table::Key< double > sigma
A FunctorKey for ShapeResult.
ErrElement xx_xy_Cov
xx,xy term in the uncertainty convariance matrix
void setShapeErr(ShapeCov const &matrix)
Set the struct uncertainty elements from the given matrix, with rows and columns ordered (xx...
ErrElement xx_yy_Cov
xx,yy term in the uncertainty convariance matrix
afw::geom::ellipses::Quadrupole Shape
A reusable struct for moments-based shape measurements.
virtual void set(afw::table::BaseRecord &record, ShapeResult const &value) const
Set a ShapeResult in the given record.
static QuadrupoleKey addFields(Schema &schema, std::string const &name, std::string const &doc, CoordinateType coordType=CoordinateType::PIXEL)
afw::table::QuadrupoleKey _shape
double const getIyy() const
ShapeResult()
Constructor; initializes everything to NaN.
virtual ShapeResult get(afw::table::BaseRecord const &record) const
Get a ShapeResult from the given record.
Base class for all records.
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
Algorithm provides no uncertainy information at all.
ErrElement yySigma
1-Sigma uncertainty on yy (sqrt of variance)
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
bool isValid() const
Return True if all the constituent sigma Keys are valid.
ErrElement xxSigma
1-Sigma uncertainty on xx (sqrt of variance)
void setShape(Shape const &shape)
Set struct elements from the given Quadrupole object.
Eigen::Matrix< ShapeElement, 3, 3, Eigen::DontAlign > ShapeTrMatrix
ShapeCov const getShapeErr() const
Return the 3x3 symmetric covariance matrix, with rows and columns ordered (xx, yy, xy)
afw::table::CovarianceMatrixKey< ErrElement, 3 > _shapeErr
double const getIxx() const
static ShapeResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty, afw::table::CoordinateType coordType=afw::table::CoordinateType::PIXEL)
Add the appropriate fields to a Schema, and return a ShapeResultKey that manages them.