23 #ifndef AFW_TABLE_aggregates_h_INCLUDED
24 #define AFW_TABLE_aggregates_h_INCLUDED
34 template <
typename T,
int N>
62 std::string
const& unit);
93 bool isValid()
const {
return _x.isValid() && _y.isValid(); }
153 bool operator==(
CoordKey const& other)
const {
return _ra == other._ra && _dec == other._dec; }
158 bool isValid()
const {
return _ra.isValid() && _dec.isValid(); }
172 bool operator==(CoordKey
const& lhs, CoordKey
const& rhs);
174 bool operator!=(CoordKey
const& lhs, CoordKey
const& rhs);
204 : _ixx(ixx), _iyy(iyy), _ixy(ixy) {}
225 return _ixx == other._ixx && _iyy == other._iyy && _ixy == other._ixy;
262 std::string
const& unit);
287 bool operator==(
EllipseKey const& other)
const {
return _qKey == other._qKey && _pKey == other._pKey; }
306 template <
typename T,
int N>
327 std::string
const& unit,
bool diagonalOnly =
false);
344 NameArray const& units,
bool diagonalOnly =
false);
384 virtual Eigen::Matrix<T, N, N>
get(
BaseRecord const& record)
const;
387 virtual void set(
BaseRecord& record, Eigen::Matrix<T, N, N>
const& value)
const;
417 #endif // !AFW_TABLE_aggregates_h_INCLUDED
bool isValid() const
Return true if the key was initialized to valid offset.
Key< double > getIxy() const
Return a constituent Key.
CoordKey()
Default constructor; instance will not be usable unless subsequently assigned to. ...
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
PointKey< double > getCenter() const
Return constituent FunctorKeys.
A coordinate class intended to represent absolute positions (2-d specialization). ...
EllipseKey(QuadrupoleKey const &qKey, PointKey< double > const &pKey)
Construct from individual Keys.
A proxy type for name lookups in a Schema.
QuadrupoleKey(SubSchema const &s)
Construct from a subschema with appropriate subfields.
Key< T > getY() const
Return the underlying y Key.
static PointKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a pair of _x, _y fields to a Schema, and return a PointKey that points to them.
std::vector< std::string > NameArray
QuadrupoleKey getCore() const
Return constituent FunctorKeys.
EllipseKey()
Default constructor; instance will not be usable unless subsequently assigned to. ...
Key< double > getIyy() const
Return a constituent Key.
static CovarianceMatrixKey addFields(Schema &schema, std::string const &prefix, NameArray const &names, std::string const &unit, bool diagonalOnly=false)
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them...
QuadrupoleKey()
Default constructor; instance will not be usable unless subsequently assigned to. ...
virtual void set(BaseRecord &record, geom::Point< T, 2 > const &value) const
Set a Point in the given record.
std::vector< Key< T > > CovarianceKeyArray
EllipseKey(SubSchema const &s)
Construct from a subschema, assuming (xx, yy, xy, x, y) subfields.
bool isValid() const
Return True if all the constituent Keys are valid.
Key< double > getIxx() const
Return a constituent Key.
PointKey< int > Point2IKey
bool operator==(CoordKey const &other) const
Compare CoordKeys for equality using the constituent ra and dec Keys.
bool operator!=(PointKey< T > const &other) const
Compare the FunctorKey for equality with another, using the underlying x and y Keys.
bool operator!=(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
bool operator==(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
PointKey< double > Point2DKey
static CoordKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
Add a pair of _ra, _dec fields to a Schema, and return a CoordKey that points to them.
Key< T > getX() const
Return the underlying x Key.
bool isValid() const
Return True if both the x and y Keys are valid.
bool operator!=(CoordKey const &other) const
Compare CoordKeys for equality using the constituent ra and dec Keys.
A FunctorKey used to get or set a geom::Point from an (x,y) pair of int or double Keys...
static QuadrupoleKey addFields(Schema &schema, std::string const &name, std::string const &doc, CoordinateType coordType=CoordinateType::PIXEL)
Add a set of quadrupole subfields to a schema and return a QuadrupoleKey that points to them...
bool operator==(PointKey< T > const &other) const
Compare the FunctorKey for equality with another, using the underlying x and y Keys.
bool isValid() const
Return True if all the constituent Keys are valid.
An ellipse defined by an arbitrary BaseCore and a center point.
bool operator!=(QuadrupoleKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Ixx, Iyy, Ixy Keys...
Key< geom::Angle > getDec() const
Return a constituent Key.
virtual void set(BaseRecord &record, coord::IcrsCoord const &value) const
Set an IcrsCoord in the given record.
bool operator==(CovarianceMatrixKey const &other) const
Compare the FunctorKey for equality with another, using its constituent Keys.
CoordKey(Key< geom::Angle > const &ra, Key< geom::Angle > const &dec)
Construct from a pair of Keys.
table::Key< std::string > name
afw::table::Key< double > sigma
T getElement(BaseRecord const &record, int i, int j) const
Return the element in row i and column j.
virtual void set(BaseRecord &record, geom::ellipses::Quadrupole const &value) const
Set a Quadrupole in the given record.
bool operator!=(EllipseKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Ixx, Iyy, Ixy Keys...
CoordinateType
Enum used to set units for geometric FunctorKeys.
Base class for all records.
bool operator!=(CovarianceMatrixKey const &other) const
Compare the FunctorKey for equality with another, using its constituent Keys.
std::vector< Key< T > > SigmaKeyArray
A class used as a handle to a particular field in a table.
PointKey()
Default constructor; instance will not be usable unless subsequently assigned to. ...
bool operator==(EllipseKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Ixx, Iyy, Ixy Keys...
virtual void set(BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix) ...
PointKey(SubSchema const &s)
Construct from a subschema, assuming x and y subfields.
PointKey(Key< T > const &x, Key< T > const &y)
Construct from a pair of Keys.
virtual void set(BaseRecord &record, geom::ellipses::Ellipse const &value) const
Set an Ellipse in the given record.
bool isValid() const
Return True if all the constituent sigma Keys are valid.
CoordKey(SubSchema const &s)
Construct from a subschema, assuming ra and dec subfields.
A FunctorKey used to get or set a geom::ellipses::Ellipse from an (xx,yy,xy,x,y) tuple of Keys...
Convenience base class that combines the OutputFunctorKey and InputFunctorKey.
This is the base class for spherical coordinates.
QuadrupoleKey(Key< double > const &ixx, Key< double > const &iyy, Key< double > const &ixy)
Construct from individual Keys.
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys...
A class to handle Icrs coordinates (inherits from Coord)
static EllipseKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a set of _xx, _yy, _xy, _x, _y fields to a Schema, and return an EllipseKey that points to them...
Key< geom::Angle > getRa() const
Return a constituent Key.
bool operator==(QuadrupoleKey const &other) const
Compare the FunctorKey for equality with another, using the underlying Ixx, Iyy, Ixy Keys...
afw::table::Schema schema
CovarianceMatrixKey()
Construct an invalid instance; must assign before subsequent use.
void setElement(BaseRecord &record, int i, int j, T value) const
Set the element in row i and column j.
A FunctorKey used to get or set celestial coordinates from a pair of Angle keys.