lsst.afw  15.0-21-g91b8abf62
Public Types | 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< SpherePoint > lsst::afw::table::OutputFunctorKey< SpherePoint > lsst::afw::table::InputFunctorKey< SpherePoint >

Public Types

using Value = SpherePoint
 The data type for get and set. More...
 

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...
 
 CoordKey (CoordKey const &)=default
 
 CoordKey (CoordKey &&)=default
 
CoordKey & operator= (CoordKey const &)=default
 
CoordKey & operator= (CoordKey &&)=default
 
virtual ~CoordKey ()=default
 
virtual SpherePoint get (BaseRecord const &record) const
 Get an SpherePoint from the given record. More...
 
virtual void set (BaseRecord &record, SpherePoint const &value) const
 Set an SpherePoint in the given record. 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 205 of file aggregates.h.

Member Typedef Documentation

◆ Value

The data type for get and set.

Definition at line 77 of file FunctorKey.h.

Constructor & Destructor Documentation

◆ CoordKey() [1/5]

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

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

Definition at line 218 of file aggregates.h.

◆ CoordKey() [2/5]

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 221 of file aggregates.h.

◆ CoordKey() [3/5]

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 231 of file aggregates.h.

◆ CoordKey() [4/5]

lsst::afw::table::CoordKey::CoordKey ( CoordKey const &  )
default

◆ CoordKey() [5/5]

lsst::afw::table::CoordKey::CoordKey ( CoordKey &&  )
default

◆ ~CoordKey()

virtual lsst::afw::table::CoordKey::~CoordKey ( )
virtualdefault

Member Function Documentation

◆ addFields()

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.

Definition at line 83 of file aggregates.cc.

◆ get()

geom::SpherePoint lsst::afw::table::CoordKey::get ( BaseRecord const &  record) const
virtual

Get an SpherePoint from the given record.

Implements lsst::afw::table::OutputFunctorKey< SpherePoint >.

Definition at line 89 of file aggregates.cc.

◆ getDec()

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

Return a constituent Key.

Definition at line 256 of file aggregates.h.

◆ getRa()

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

Return a constituent Key.

Definition at line 255 of file aggregates.h.

◆ isValid()

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

Definition at line 251 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 248 of file aggregates.h.

◆ operator=() [1/2]

CoordKey& lsst::afw::table::CoordKey::operator= ( CoordKey const &  )
default

◆ operator=() [2/2]

CoordKey& lsst::afw::table::CoordKey::operator= ( CoordKey &&  )
default

◆ 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 247 of file aggregates.h.

◆ set()

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

Set an SpherePoint in the given record.

Implements lsst::afw::table::InputFunctorKey< SpherePoint >.

Definition at line 93 of file aggregates.cc.


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