23#ifndef AFW_TABLE_aggregates_h_INCLUDED
24#define AFW_TABLE_aggregates_h_INCLUDED
45template <
typename T,
int N>
106 bool isValid() const noexcept {
return _x.isValid() && _y.isValid(); }
171 return _x == other._x && _y == other._y && _z == other._z; }
182 bool isValid() const noexcept {
return _x.isValid() && _y.isValid() && _z.isValid(); }
207template <
typename Box>
265 bool operator==(
BoxKey const& other)
const noexcept {
return _min == other._min && _max == other._max; }
270 bool isValid() const noexcept {
return _min.isValid() && _max.isValid(); }
314 : _ra(ra), _dec(dec) {}
340 bool operator==(
CoordKey const& other) const noexcept {
return _ra == other._ra && _dec == other._dec; }
350 bool isValid() const noexcept {
return _ra.isValid() && _dec.isValid(); }
390 : _ixx(ixx), _iyy(iyy), _ixy(ixy) {}
412 void set(
BaseRecord& record,
geom::ellipses::Quadrupole const& value) const override;
417 return _ixx == other._ixx && _iyy == other._iyy && _ixy == other._ixy;
429 bool isValid() const noexcept {
return _ixx.isValid() && _iyy.isValid() && _ixy.isValid(); }
488 void set(
BaseRecord& record,
geom::ellipses::Ellipse const& value) const override;
493 return _qKey == other._qKey && _pKey == other._pKey;
505 bool isValid() const noexcept {
return _qKey.isValid() && _pKey.isValid(); }
518template <
typename T,
int N>
539 std::string const& unit,
bool diagonalOnly =
false);
556 NameArray const& units,
bool diagonalOnly =
false);
605 void set(
BaseRecord& record, Eigen::Matrix<T, N, N> const& value) const override;
642 bool diagonalOnly =
false);
644 bool diagonalOnly =
false);
695template <
typename T,
int N>
696struct hash<
lsst::afw::table::CovarianceMatrixKey<T, N>> {
696struct hash<
lsst::afw::table::CovarianceMatrixKey<T, N>> {
…};
An ellipse core with quadrupole moments as parameters.
Base class for all records.
A FunctorKey used to get or set a lsst::geom::Box2I or Box2D from a (min, max) pair of Point3Keys.
BoxKey(BoxKey const &) noexcept=default
bool operator!=(BoxKey const &other) const noexcept
bool isValid() const noexcept
Return True if both the min and max PointKeys are valid.
std::size_t hash_value() const noexcept
Box get(BaseRecord const &record) const override
Get a Box from the given record.
static BoxKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add _min_x, _min_y, _max_x, _max_y fields to a Schema, and return a BoxKey that points to them.
PointKey< Element > getMin() const noexcept
Return the underlying min PointKey.
PointKey< Element > getMax() const noexcept
Return the underlying max PointKey.
typename Box::Element Element
Type of coordinate elements (i.e. int or double).
BoxKey() noexcept=default
Default constructor; instance will not be usable unless subsequently assigned to.
bool operator==(BoxKey const &other) const noexcept
Compare the FunctorKey for equality with another, using the underlying x and y Keys.
void set(BaseRecord &record, Box const &value) const override
Set a Box in the given record.
BoxKey(BoxKey &&) noexcept=default
BoxKey(SubSchema const &s)
Construct from a subschema, assuming _min_x, _max_x, _min_y, _max_y subfields.
CoordErrKey(ErrKeyArray const &err, CovarianceKeyArray const &cov=CovarianceKeyArray())
static CoordErrKey addFields(Schema &schema, std::string const &name, std::string const &unit, bool diagonalOnly=false)
std::vector< Key< float > > ErrKeyArray
std::vector< Key< float > > CovarianceKeyArray
std::vector< std::string > NameArray
CoordErrKey(SubSchema const &s, std::string const &name)
static CoordErrKey addFields(Schema &schema, std::string const &name, NameArray const &units, bool diagonalOnly=false)
A FunctorKey used to get or set celestial coordinates from a pair of lsst::geom::Angle keys.
bool operator!=(CoordKey const &other) const noexcept
CoordKey(Key< lsst::geom::Angle > const &ra, Key< lsst::geom::Angle > const &dec) noexcept
Construct from a pair of Keys.
CovarianceMatrixKey< float, 2 > ErrorKey
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.
CoordKey(SubSchema const &s)
Construct from a subschema, assuming ra and dec subfields.
CoordKey() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
void set(BaseRecord &record, lsst::geom::SpherePoint const &value) const override
Set an lsst::geom::SpherePoint in the given record.
Key< lsst::geom::Angle > getDec() const noexcept
static ErrorKey addErrorFields(Schema &schema)
Key< lsst::geom::Angle > getRa() const noexcept
Return a constituent Key.
std::size_t hash_value() const noexcept
Return a hash of this object.
static ErrorKey getErrorKey(Schema const &schema)
CoordKey(CoordKey &&) noexcept=default
bool isValid() const noexcept
CoordKey(CoordKey const &) noexcept=default
lsst::geom::SpherePoint get(BaseRecord const &record) const override
Get an lsst::geom::SpherePoint from the given record.
CovarianceMatrixKey(ErrKeyArray const &err, CovarianceKeyArray const &cov=CovarianceKeyArray())
Construct a from arrays of per-element Keys.
std::vector< Key< float > > CovarianceKeyArray
static CovarianceMatrixKey addFields(Schema &schema, std::string const &prefix, NameArray const &names, NameArray const &units, bool diagonalOnly=false)
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them.
CovarianceMatrixKey()
Construct an invalid instance; must assign before subsequent use.
std::vector< Key< float > > ErrKeyArray
CovarianceMatrixKey(CovarianceMatrixKey const &)
std::vector< std::string > NameArray
Eigen::Matrix< float, N, N > get(BaseRecord const &record) const override
void setElement(BaseRecord &record, int i, int j, float value) const
CovarianceMatrixKey & operator=(CovarianceMatrixKey &&)
float getElement(BaseRecord const &record, int i, int j) const
void set(BaseRecord &record, Eigen::Matrix< float, N, N > const &value) const override
CovarianceMatrixKey(SubSchema const &s, NameArray const &names)
Construct from a subschema and an array of names for each parameter of the matrix.
~CovarianceMatrixKey() noexcept override
CovarianceMatrixKey(CovarianceMatrixKey &&)
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.
std::size_t hash_value() const noexcept
Return a hash of this object.
bool isValid() const noexcept
CovarianceMatrixKey & operator=(CovarianceMatrixKey const &)
A FunctorKey used to get or set a geom::ellipses::Ellipse from an (xx,yy,xy,x,y) tuple of Keys.
void set(BaseRecord &record, geom::ellipses::Ellipse const &value) const override
Set an Ellipse in the given record.
EllipseKey(EllipseKey &&) noexcept=default
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.
PointKey< double > getCenter() const noexcept
geom::ellipses::Ellipse get(BaseRecord const &record) const override
Get an Ellipse from the given record.
EllipseKey() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
std::size_t hash_value() const noexcept
Return a hash of this object.
bool operator!=(EllipseKey const &other) const noexcept
EllipseKey(EllipseKey const &) noexcept=default
EllipseKey(SubSchema const &s)
Construct from a subschema, assuming (xx, yy, xy, x, y) subfields.
QuadrupoleKey getCore() const noexcept
Return constituent FunctorKeys.
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
EllipseKey(QuadrupoleKey const &qKey, PointKey< double > const &pKey) noexcept
Construct from individual Keys.
Convenience base class that combines the OutputFunctorKey and InputFunctorKey.
A class used as a handle to a particular field in a table.
A FunctorKey used to get or set a lsst::geom::Point3 from an (x,y,z) tuple of int or double Keys.
Key< T > getX() const noexcept
Return the underlying x Key.
std::size_t hash_value() const noexcept
Return a hash of this object.
bool operator!=(Point3Key< T > const &other) const noexcept
Point3Key(Point3Key const &) noexcept=default
void set(BaseRecord &record, lsst::geom::Point< T, 3 > const &value) const override
Set a Point in the given record.
Point3Key(Point3Key &&) noexcept=default
bool operator==(Point3Key< T > const &other) const noexcept
Compare the FunctorKey for equality with another, using the underlying x, y, and z Keys.
static Point3Key addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a pair of _x, _y, _z fields to a Schema, and return a Point3Key that points to them.
Key< T > getY() const noexcept
Return the underlying y Key.
Point3Key() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
Key< T > getZ() const noexcept
Return the underlying y Key.
lsst::geom::Point< T, 3 > get(BaseRecord const &record) const override
Get a Point from the given record.
Point3Key(Key< T > const &x, Key< T > const &y, Key< T > const &z) noexcept
Construct from a pair of Keys.
bool isValid() const noexcept
Return True if all of the x, y, and z Keys are valid.
A FunctorKey used to get or set a lsst::geom::Point from an (x,y) pair of int or double Keys.
std::size_t hash_value() const noexcept
Return a hash of this object.
PointKey() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
Key< T > getY() const noexcept
Return the underlying y Key.
PointKey(PointKey const &) noexcept=default
void set(BaseRecord &record, lsst::geom::Point< T, 2 > const &value) const override
Set a Point in the given record.
PointKey(PointKey &&) noexcept=default
bool operator!=(PointKey< T > const &other) const noexcept
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.
PointKey(Key< T > const &x, Key< T > const &y) noexcept
Construct from a pair of Keys.
bool operator==(PointKey< T > const &other) const noexcept
Compare the FunctorKey for equality with another, using the underlying x and y Keys.
Key< T > getX() const noexcept
Return the underlying x Key.
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
lsst::geom::Point< T, 2 > get(BaseRecord const &record) const override
Get a Point from the given record.
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys.
std::size_t hash_value() const noexcept
Return a hash of this object.
Key< double > getIxx() const noexcept
Return a constituent Key.
geom::ellipses::Quadrupole get(BaseRecord const &record) const override
Get a Quadrupole from the given record.
QuadrupoleKey() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
QuadrupoleKey(SubSchema const &s)
Construct from a subschema with appropriate subfields.
QuadrupoleKey(QuadrupoleKey const &) noexcept=default
Key< double > getIxy() const noexcept
Key< double > getIyy() const noexcept
void set(BaseRecord &record, geom::ellipses::Quadrupole const &value) const override
Set a Quadrupole in the given record.
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.
QuadrupoleKey(Key< double > const &ixx, Key< double > const &iyy, Key< double > const &ixy) noexcept
Construct from individual Keys.
QuadrupoleKey(QuadrupoleKey &&) noexcept=default
bool operator!=(QuadrupoleKey const &other) const noexcept
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Defines the fields and offsets for a table.
A proxy type for name lookups in a Schema.
A coordinate class intended to represent absolute positions.
Point3Key< double > Point3DKey
Point3Key< int > Point3IKey
BoxKey< lsst::geom::Box2I > Box2IKey
PointKey< int > Point2IKey
CoordinateType
Enum used to set units for geometric FunctorKeys.
lsst::geom::SpherePoint SpherePoint
BoxKey< lsst::geom::Box2D > Box2DKey
PointKey< double > Point2DKey
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
lsst::afw::table::BoxKey< T > argument_type
size_t operator()(argument_type const &obj) const noexcept
size_t operator()(argument_type const &obj) const noexcept
lsst::afw::table::CoordKey argument_type
lsst::afw::table::CovarianceMatrixKey< T, N > argument_type
size_t operator()(argument_type const &obj) const noexcept
lsst::afw::table::EllipseKey argument_type
size_t operator()(argument_type const &obj) const noexcept
size_t operator()(argument_type const &obj) const noexcept
lsst::afw::table::PointKey< T > argument_type
lsst::afw::table::QuadrupoleKey argument_type
size_t operator()(argument_type const &obj) const noexcept