LSSTApplications  20.0.0
LSSTDataManagementBasePackage
slots.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef LSST_AFW_TABLE_slots_h_INCLUDED
3 #define LSST_AFW_TABLE_slots_h_INCLUDED
4 
6 
7 namespace lsst {
8 
9 namespace daf {
10 namespace base {
11 class PropertySet;
12 }
13 } // namespace daf
14 
15 namespace afw {
16 
17 namespace fits {
18 class Fits;
19 }; // namespace fits
20 
21 namespace table {
22 
48 public:
50  explicit SlotDefinition(std::string const &name) : _name(name) {}
51 
53  std::string getName() const { return _name; }
54 
60  std::string getAlias() const { return "slot_" + _name; }
61 
62  SlotDefinition(SlotDefinition const &) = default;
66  ~SlotDefinition() = default;
67 
68 protected:
70 };
71 
74 public:
75  typedef double MeasValue;
76  typedef double ErrValue;
77  typedef Key<double> MeasKey;
78  typedef Key<double> ErrKey;
79 
82 
84  bool isValid() const { return _measKey.isValid(); }
85 
87  MeasKey getMeasKey() const { return _measKey; }
88 
90  ErrKey getErrKey() const { return _errKey; }
91 
93  Key<Flag> getFlagKey() const { return _flagKey; }
94 
105  void setKeys(std::string const &alias, Schema const &schema);
106 
111  ~FluxSlotDefinition() = default;
112 
113 private:
114  MeasKey _measKey;
115  ErrKey _errKey;
116  Key<Flag> _flagKey;
117 };
118 
121 public:
123  typedef Eigen::Matrix<float, 2, 2> ErrValue;
124  typedef Point2DKey MeasKey;
126 
129 
131  bool isValid() const { return _measKey.isValid(); }
132 
134  MeasKey getMeasKey() const { return _measKey; }
135 
137  ErrKey getErrKey() const { return _errKey; }
138 
140  Key<Flag> getFlagKey() const { return _flagKey; }
141 
152  void setKeys(std::string const &alias, Schema const &schema);
153 
159 
160 private:
161  MeasKey _measKey;
162  ErrKey _errKey;
163  Key<Flag> _flagKey;
164 };
165 
168 public:
170  typedef Eigen::Matrix<float, 3, 3> ErrValue;
173 
176 
178  bool isValid() const { return _measKey.isValid(); }
179 
181  MeasKey getMeasKey() const { return _measKey; }
182 
184  ErrKey getErrKey() const { return _errKey; }
185 
187  Key<Flag> getFlagKey() const { return _flagKey; }
188 
199  void setKeys(std::string const &alias, Schema const &schema);
200 
205  ~ShapeSlotDefinition() = default;
206 
207 private:
208  MeasKey _measKey;
209  ErrKey _errKey;
210  Key<Flag> _flagKey;
211 };
212 
219 struct SlotSuite {
227 
229  void handleAliasChange(std::string const &alias, Schema const &schema);
230 
232  explicit SlotSuite(Schema const &schema);
233 };
234 } // namespace table
235 } // namespace afw
236 } // namespace lsst
237 
238 #endif // !LSST_AFW_TABLE_slots_h_INCLUDED
lsst::afw::table::ShapeSlotDefinition::getMeasKey
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:181
schema
table::Schema schema
Definition: Amplifier.cc:115
lsst::afw::table::ShapeSlotDefinition::getErrKey
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:184
lsst::afw::table::FluxSlotDefinition::ErrValue
double ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:76
lsst::afw::table::CentroidSlotDefinition::setKeys
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
Definition: slots.cc:64
lsst::afw::table::FluxSlotDefinition::getMeasKey
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:87
lsst::afw::table::FluxSlotDefinition::FluxSlotDefinition
FluxSlotDefinition(FluxSlotDefinition &&)=default
lsst::afw::table::CentroidSlotDefinition::isValid
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:131
std::string
STL class.
lsst::afw::table::CentroidSlotDefinition::MeasValue
lsst::geom::Point2D MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:122
lsst::afw::table::SlotDefinition::getAlias
std::string getAlias() const
Return the alias field prefix used to lookup Keys for the slot.
Definition: slots.h:60
lsst::afw::table::CentroidSlotDefinition::CentroidSlotDefinition
CentroidSlotDefinition(CentroidSlotDefinition const &)=default
lsst::afw::table::ShapeSlotDefinition::MeasValue
geom::ellipses::Quadrupole MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:169
base
Definition: __init__.py:1
lsst::afw::table::SlotDefinition::SlotDefinition
SlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Centroid" or "PsfFlux")
Definition: slots.h:50
lsst::afw::table::FluxSlotDefinition::getFlagKey
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:93
lsst::afw::table::CentroidSlotDefinition::operator=
CentroidSlotDefinition & operator=(CentroidSlotDefinition const &)=default
lsst::afw::table::FluxSlotDefinition::MeasKey
Key< double > MeasKey
Key type used to access the slot measurement.
Definition: slots.h:77
lsst::afw::table::FluxSlotDefinition::setKeys
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
Definition: slots.cc:32
lsst::afw::table::SlotSuite::defApFlux
FluxSlotDefinition defApFlux
Definition: slots.h:221
lsst::afw::table::CentroidSlotDefinition::CentroidSlotDefinition
CentroidSlotDefinition(CentroidSlotDefinition &&)=default
lsst::afw::table::ShapeSlotDefinition::ShapeSlotDefinition
ShapeSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Shape")
Definition: slots.h:175
lsst::afw
Definition: imageAlgorithm.dox:1
lsst::afw::table::ShapeSlotDefinition::ErrKey
CovarianceMatrixKey< float, 3 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:172
lsst::afw::table::CentroidSlotDefinition::operator=
CentroidSlotDefinition & operator=(CentroidSlotDefinition &&)=default
lsst::afw::table::SlotSuite::defCalibFlux
FluxSlotDefinition defCalibFlux
Definition: slots.h:224
lsst::afw::table::ShapeSlotDefinition
SlotDefinition specialization for shapes.
Definition: slots.h:167
lsst::afw::table::Schema
Defines the fields and offsets for a table.
Definition: Schema.h:50
lsst::afw::table::ShapeSlotDefinition::MeasKey
QuadrupoleKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:171
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
aggregates.h
lsst::afw::table::FluxSlotDefinition::ErrKey
Key< double > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:78
lsst::afw::table::SlotSuite::SlotSuite
SlotSuite(Schema const &schema)
Initialize the slots.
Definition: slots.cc:126
lsst::afw::table::CovarianceMatrixKey< float, 2 >
lsst::afw::table::SlotDefinition::operator=
SlotDefinition & operator=(SlotDefinition const &)=default
lsst::afw::table::CentroidSlotDefinition
SlotDefinition specialization for centroids.
Definition: slots.h:120
lsst::afw::table::FluxSlotDefinition
SlotDefinition specialization for fluxes.
Definition: slots.h:73
lsst::afw::table::SlotSuite::defCentroid
CentroidSlotDefinition defCentroid
Definition: slots.h:225
lsst::afw::table::CentroidSlotDefinition::getFlagKey
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:140
fits
Fits * fits
Definition: FitsWriter.cc:90
lsst::afw::table::PointKey< double >
lsst::afw::table::PointKey::isValid
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
Definition: aggregates.h:104
lsst::afw::table::FluxSlotDefinition::getErrKey
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:90
lsst::afw::table::QuadrupoleKey
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys.
Definition: aggregates.h:282
lsst::afw::table::ShapeSlotDefinition::ShapeSlotDefinition
ShapeSlotDefinition(ShapeSlotDefinition const &)=default
lsst::afw::table::FluxSlotDefinition::operator=
FluxSlotDefinition & operator=(FluxSlotDefinition &&)=default
lsst::afw::table::FluxSlotDefinition::~FluxSlotDefinition
~FluxSlotDefinition()=default
lsst::afw::table::SlotDefinition
Base class for helper classes that define slots on SourceTable/SourceRecord.
Definition: slots.h:47
lsst::afw::table::SlotSuite::defPsfFlux
FluxSlotDefinition defPsfFlux
Definition: slots.h:220
lsst::afw::table::Key< double >
lsst::afw::table::FluxSlotDefinition::MeasValue
double MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:75
lsst::afw::table::Key::isValid
bool isValid() const noexcept
Return true if the key was initialized to valid offset.
Definition: Key.h:97
lsst::afw::table::CentroidSlotDefinition::getErrKey
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:137
lsst::afw::table::FluxSlotDefinition::operator=
FluxSlotDefinition & operator=(FluxSlotDefinition const &)=default
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::afw::table::FluxSlotDefinition::FluxSlotDefinition
FluxSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "PsfFlux")
Definition: slots.h:81
lsst::afw::geom::ellipses::Quadrupole
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
lsst::afw::table::SlotDefinition::_name
std::string _name
Definition: slots.h:69
lsst::afw::table::SlotDefinition::SlotDefinition
SlotDefinition(SlotDefinition &&)=default
lsst::afw::table::FluxSlotDefinition::FluxSlotDefinition
FluxSlotDefinition(FluxSlotDefinition const &)=default
lsst::afw::table::CentroidSlotDefinition::~CentroidSlotDefinition
~CentroidSlotDefinition()=default
lsst::afw::table::CentroidSlotDefinition::ErrKey
CovarianceMatrixKey< float, 2 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:125
lsst::geom::Point< double, 2 >
lsst::afw::table::CentroidSlotDefinition::MeasKey
Point2DKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:124
lsst::afw::table::ShapeSlotDefinition::ShapeSlotDefinition
ShapeSlotDefinition(ShapeSlotDefinition &&)=default
lsst::afw::table::ShapeSlotDefinition::setKeys
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
Definition: slots.cc:96
lsst::afw::table::ShapeSlotDefinition::operator=
ShapeSlotDefinition & operator=(ShapeSlotDefinition &&)=default
lsst::afw::table::SlotSuite
An aggregate containing all of the current slots used in SourceTable.
Definition: slots.h:219
lsst::afw::table::ShapeSlotDefinition::ErrValue
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:170
lsst::afw::table::CentroidSlotDefinition::getMeasKey
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:134
lsst::afw::table::FluxSlotDefinition::isValid
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:84
lsst::afw::table::SlotSuite::handleAliasChange
void handleAliasChange(std::string const &alias, Schema const &schema)
Handle a callback from an AliasMap informing the table that an alias has changed.
Definition: slots.cc:116
lsst::afw::table::ShapeSlotDefinition::getFlagKey
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:187
lsst::afw::table::SlotSuite::defGaussianFlux
FluxSlotDefinition defGaussianFlux
Definition: slots.h:222
lsst::afw::table::SlotDefinition::~SlotDefinition
~SlotDefinition()=default
lsst::afw::table::ShapeSlotDefinition::isValid
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:178
lsst::afw::table::CentroidSlotDefinition::ErrValue
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:123
lsst::afw::table::SlotDefinition::operator=
SlotDefinition & operator=(SlotDefinition &&)=default
lsst::afw::table::SlotDefinition::getName
std::string getName() const
Return the name of the slot (e.g. "Centroid" or "PsfFlux")
Definition: slots.h:53
lsst::afw::table::ShapeSlotDefinition::~ShapeSlotDefinition
~ShapeSlotDefinition()=default
lsst::afw::table::SlotDefinition::SlotDefinition
SlotDefinition(SlotDefinition const &)=default
lsst::afw::table::Key< Flag >
Key specialization for Flag.
Definition: Flag.h:94
lsst::afw::table::SlotSuite::defShape
ShapeSlotDefinition defShape
Definition: slots.h:226
lsst::afw::table::SlotSuite::defModelFlux
FluxSlotDefinition defModelFlux
Definition: slots.h:223
lsst::afw::table::CentroidSlotDefinition::CentroidSlotDefinition
CentroidSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Centroid")
Definition: slots.h:128
lsst::afw::table::QuadrupoleKey::isValid
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:342
lsst::afw::table::ShapeSlotDefinition::operator=
ShapeSlotDefinition & operator=(ShapeSlotDefinition const &)=default