lsst.afw  14.0-25-g0e8fc950e+3
Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::table::CoordKey Class Reference

A FunctorKey used to get or set celestial coordinates from a pair of Angle keys. More...

#include <aggregates.h>

Inheritance diagram for lsst::afw::table::CoordKey:
lsst::afw::table::FunctorKey< coord::IcrsCoord > lsst::afw::table::OutputFunctorKey< coord::IcrsCoord > lsst::afw::table::InputFunctorKey< coord::IcrsCoord >

Public Member Functions

 CoordKey ()
 Default constructor; instance will not be usable unless subsequently assigned to. More...
 
 CoordKey (Key< geom::Angle > const &ra, Key< geom::Angle > const &dec)
 Construct from a pair of Keys. More...
 
 CoordKey (SubSchema const &s)
 Construct from a subschema, assuming ra and dec subfields. More...
 
virtual coord::IcrsCoord get (BaseRecord const &record) const
 Get an IcrsCoord from the given record. More...
 
virtual void set (BaseRecord &record, coord::IcrsCoord const &value) const
 Set an IcrsCoord in the given record. More...
 
virtual void set (BaseRecord &record, coord::Coord const &value) const
 Set a Coord of another type in the given record; must be convertable to ICRS. More...
 
bool isValid () const
 
bool operator== (CoordKey const &other) const
 Compare CoordKeys for equality using the constituent ra and dec Keys. More...
 
bool operator!= (CoordKey const &other) const
 Compare CoordKeys for equality using the constituent ra and dec Keys. More...
 
Key< geom::Angle > getRa () const
 Return a constituent Key. More...
 
Key< geom::Angle > getDec () const
 Return a constituent Key. More...
 

Static Public Member Functions

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. More...
 

Detailed Description

A FunctorKey used to get or set celestial coordinates from a pair of Angle keys.

Coords are always stored and returned in the ICRS system. Coords in other systems may be assigned, but this will result in a conversion to ICRS.

Definition at line 115 of file aggregates.h.

Constructor & Destructor Documentation

◆ CoordKey() [1/3]

lsst::afw::table::CoordKey::CoordKey ( )
inline

Default constructor; instance will not be usable unless subsequently assigned to.

Definition at line 128 of file aggregates.h.

◆ CoordKey() [2/3]

lsst::afw::table::CoordKey::CoordKey ( Key< geom::Angle > const &  ra,
Key< geom::Angle > const &  dec 
)
inline

Construct from a pair of Keys.

Definition at line 131 of file aggregates.h.

◆ CoordKey() [3/3]

lsst::afw::table::CoordKey::CoordKey ( SubSchema const &  s)
inline

Construct from a subschema, assuming ra and dec subfields.

If a schema has "a_ra" and "a_dec" fields, this constructor allows you to construct a CoordKey via:

CoordKey k(schema["a"]);

Definition at line 141 of file aggregates.h.

Member Function Documentation

◆ addFields()

static CoordKey lsst::afw::table::CoordKey::addFields ( afw::table::Schema &  schema,
std::string const &  name,
std::string const &  doc 
)
static

Add a pair of _ra, _dec fields to a Schema, and return a CoordKey that points to them.

Parameters
[in,out]schemaSchema to add fields to.
[in]nameName prefix for all fields; "_ra", "_dec", will be appended to this to form the full field names.
[in]docString used as the documentation for the fields.

◆ get()

virtual coord::IcrsCoord lsst::afw::table::CoordKey::get ( BaseRecord const &  record) const
virtual

Get an IcrsCoord from the given record.

Implements lsst::afw::table::OutputFunctorKey< coord::IcrsCoord >.

◆ getDec()

Key<geom::Angle> lsst::afw::table::CoordKey::getDec ( ) const
inline

Return a constituent Key.

Definition at line 163 of file aggregates.h.

◆ getRa()

Key<geom::Angle> lsst::afw::table::CoordKey::getRa ( ) const
inline

Return a constituent Key.

Definition at line 162 of file aggregates.h.

◆ isValid()

bool lsst::afw::table::CoordKey::isValid ( ) const
inline

Definition at line 158 of file aggregates.h.

◆ operator!=()

bool lsst::afw::table::CoordKey::operator!= ( CoordKey const &  other) const
inline

Compare CoordKeys for equality using the constituent ra and dec Keys.

Definition at line 155 of file aggregates.h.

◆ operator==()

bool lsst::afw::table::CoordKey::operator== ( CoordKey const &  other) const
inline

Compare CoordKeys for equality using the constituent ra and dec Keys.

Definition at line 154 of file aggregates.h.

◆ set() [1/2]

virtual void lsst::afw::table::CoordKey::set ( BaseRecord &  record,
coord::IcrsCoord const &  value 
) const
virtual

Set an IcrsCoord in the given record.

Implements lsst::afw::table::InputFunctorKey< coord::IcrsCoord >.

◆ set() [2/2]

virtual void lsst::afw::table::CoordKey::set ( BaseRecord &  record,
coord::Coord const &  value 
) const
virtual

Set a Coord of another type in the given record; must be convertable to ICRS.


The documentation for this class was generated from the following file: