LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Protected Attributes | List of all members
lsst::afw::table::CentroidSlotDefinition Class Reference

SlotDefinition specialization for centroids. More...

#include <slots.h>

Inheritance diagram for lsst::afw::table::CentroidSlotDefinition:
lsst::afw::table::SlotDefinition

Public Types

using MeasValue = lsst::geom::Point2D
 Type returned by accessing the slot measurement. More...
 
using ErrValue = Eigen::Matrix< float, 2, 2 >
 Type returned by accessing the slot uncertainty. More...
 
using MeasKey = Point2DKey
 Key type used to access the slot measurement. More...
 
using ErrKey = CovarianceMatrixKey< float, 2 >
 Key type used to access the slot uncertainty. More...
 

Public Member Functions

 CentroidSlotDefinition (std::string const &name)
 Construct a SlotDefinition from the name of the slot (e.g. "Centroid") More...
 
bool isValid () const
 Return true if the key associated with the measurement is valid. More...
 
MeasKey getMeasKey () const
 Return the cached Key used to access the slot measurement. More...
 
ErrKey getErrKey () const
 Return the cached Key used to access the slot uncertainty. More...
 
Key< Flag > getFlagKey () const
 Return the cached Key used to access the slot failure flag. More...
 
void setKeys (std::string const &alias, Schema const &schema)
 Update the cached Keys following an change of aliases in the given Schema. More...
 
 CentroidSlotDefinition (CentroidSlotDefinition const &)=default
 
 CentroidSlotDefinition (CentroidSlotDefinition &&)=default
 
CentroidSlotDefinitionoperator= (CentroidSlotDefinition const &)=default
 
CentroidSlotDefinitionoperator= (CentroidSlotDefinition &&)=default
 
 ~CentroidSlotDefinition ()=default
 
std::string getName () const
 Return the name of the slot (e.g. "Centroid" or "PsfFlux") More...
 
std::string getAlias () const
 Return the alias field prefix used to lookup Keys for the slot. More...
 

Protected Attributes

std::string _name
 

Detailed Description

SlotDefinition specialization for centroids.

Definition at line 120 of file slots.h.

Member Typedef Documentation

◆ ErrKey

Key type used to access the slot uncertainty.

Definition at line 125 of file slots.h.

◆ ErrValue

using lsst::afw::table::CentroidSlotDefinition::ErrValue = Eigen::Matrix<float, 2, 2>

Type returned by accessing the slot uncertainty.

Definition at line 123 of file slots.h.

◆ MeasKey

Key type used to access the slot measurement.

Definition at line 124 of file slots.h.

◆ MeasValue

Type returned by accessing the slot measurement.

Definition at line 122 of file slots.h.

Constructor & Destructor Documentation

◆ CentroidSlotDefinition() [1/3]

lsst::afw::table::CentroidSlotDefinition::CentroidSlotDefinition ( std::string const &  name)
inlineexplicit

Construct a SlotDefinition from the name of the slot (e.g. "Centroid")

Definition at line 128 of file slots.h.

128 : SlotDefinition(name) {}
table::Key< std::string > name
Definition: Amplifier.cc:116
SlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Centroid" or "PsfFlux")
Definition: slots.h:50

◆ CentroidSlotDefinition() [2/3]

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

◆ CentroidSlotDefinition() [3/3]

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

◆ ~CentroidSlotDefinition()

lsst::afw::table::CentroidSlotDefinition::~CentroidSlotDefinition ( )
default

Member Function Documentation

◆ getAlias()

std::string lsst::afw::table::SlotDefinition::getAlias ( ) const
inlineinherited

Return the alias field prefix used to lookup Keys for the slot.

This simply prepends "slot_" to the slot name.

Definition at line 60 of file slots.h.

60 { return "slot_" + _name; }

◆ getErrKey()

ErrKey lsst::afw::table::CentroidSlotDefinition::getErrKey ( ) const
inline

Return the cached Key used to access the slot uncertainty.

Definition at line 137 of file slots.h.

137 { return _errKey; }

◆ getFlagKey()

Key<Flag> lsst::afw::table::CentroidSlotDefinition::getFlagKey ( ) const
inline

Return the cached Key used to access the slot failure flag.

Definition at line 140 of file slots.h.

140 { return _flagKey; }

◆ getMeasKey()

MeasKey lsst::afw::table::CentroidSlotDefinition::getMeasKey ( ) const
inline

Return the cached Key used to access the slot measurement.

Definition at line 134 of file slots.h.

134 { return _measKey; }

◆ getName()

std::string lsst::afw::table::SlotDefinition::getName ( ) const
inlineinherited

Return the name of the slot (e.g. "Centroid" or "PsfFlux")

Definition at line 53 of file slots.h.

53 { return _name; }

◆ isValid()

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

Return true if the key associated with the measurement is valid.

Definition at line 131 of file slots.h.

131 { return _measKey.isValid(); }
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
Definition: aggregates.h:104

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ setKeys()

void lsst::afw::table::CentroidSlotDefinition::setKeys ( std::string const &  alias,
Schema const &  schema 
)

Update the cached Keys following an change of aliases in the given Schema.

This method is intended for internal use by SourceTable only.

Parameters
[in]aliasIf non-empty, abort early if this string does not start with getAlias() (used to see if an alias change might have affected this slot, and avoid unnecessary work if not).
[in]schemaSchema to search for Keys.

Definition at line 64 of file slots.cc.

64  {
65  SubSchema s = schema["slot"][_name];
66  if (!alias.empty() && !startsWith(alias, s.getPrefix())) return;
67  static ErrKey::NameArray names = makeCentroidNameArray();
68  _measKey = MeasKey();
69  _errKey = ErrKey();
70  _flagKey = Key<Flag>();
71  MeasFieldNameGetter helper(s, schema);
72  if (!helper.defined) return;
73  _measKey = helper.replaced;
74  try {
75  _errKey = ErrKey(s, names);
76  } catch (pex::exceptions::NotFoundError &) {
77  }
78  try {
79  _flagKey = s["flag"];
80  } catch (pex::exceptions::NotFoundError &) {
81  }
82 }
table::Schema schema
Definition: python.h:134
CovarianceMatrixKey< float, 2 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:125
Point2DKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:124

Member Data Documentation

◆ _name

std::string lsst::afw::table::SlotDefinition::_name
protectedinherited

Definition at line 69 of file slots.h.


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