LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
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 { namespace base {
10 class PropertySet;
11 }} // namespace daf::base
12 
13 namespace afw {
14 
15 namespace fits {
16 class Fits;
17 }; // namespace fits
18 
19 namespace table {
20 
21 
47 public:
48 
50  explicit SlotDefinition(std::string const & name) : _name(name) {}
51 
53  std::string getName() const { return _name; }
54 
60  std::string getAlias() const {
61  return "slot_" + _name;
62  }
63 
64 protected:
65  std::string _name;
66 };
67 
70 public:
71 
72  typedef double MeasValue;
73  typedef double ErrValue;
74  typedef Key<double> MeasKey;
75  typedef Key<double> ErrKey;
76 
78  explicit FluxSlotDefinition(std::string const & name) : SlotDefinition(name) {}
79 
81  bool isValid() const { return _measKey.isValid(); }
82 
84  MeasKey getMeasKey() const { return _measKey; }
85 
87  ErrKey getErrKey() const { return _errKey; }
88 
90  Key<Flag> getFlagKey() const { return _flagKey; }
91 
102  void setKeys(std::string const & alias, Schema const & schema);
103 
104 private:
108 };
109 
112 public:
113 
115  typedef Eigen::Matrix<float,2,2> ErrValue;
116  typedef Point2DKey MeasKey;
118 
120  explicit CentroidSlotDefinition(std::string const & name) : SlotDefinition(name) {}
121 
123  bool isValid() const { return _measKey.isValid(); }
124 
126  MeasKey getMeasKey() const { return _measKey; }
127 
129  ErrKey getErrKey() const { return _errKey; }
130 
132  Key<Flag> getFlagKey() const { return _flagKey; }
133 
144  void setKeys(std::string const & alias, Schema const & schema);
145 
146 private:
150 };
151 
154 public:
155 
157  typedef Eigen::Matrix<float,3,3> ErrValue;
160 
162  explicit ShapeSlotDefinition(std::string const & name) : SlotDefinition(name) {}
163 
165  bool isValid() const { return _measKey.isValid(); }
166 
168  MeasKey getMeasKey() const { return _measKey; }
169 
171  ErrKey getErrKey() const { return _errKey; }
172 
174  Key<Flag> getFlagKey() const { return _flagKey; }
175 
186  void setKeys(std::string const & alias, Schema const & schema);
187 
188 private:
192 };
193 
200 struct SlotSuite {
208 
210  void handleAliasChange(std::string const & alias, Schema const & schema);
211 
213  explicit SlotSuite(Schema const & schema);
214 };
215 
216 }}} // lsst::afw::table
217 
218 #endif // !LSST_AFW_TABLE_slots_h_INCLUDED
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:45
Defines the fields and offsets for a table.
Definition: Schema.h:44
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:84
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:171
QuadrupoleKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:158
table::Key< std::string > name
Definition: ApCorrMap.cc:71
bool isValid() const
Return True if all the constituent Keys are valid.
Definition: aggregates.h:244
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:165
Point2DKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:116
SlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;Centroid&quot; or &quot;PsfFlux&quot;) ...
Definition: slots.h:50
afw::table::Schema schema
Definition: GaussianPsf.cc:41
Key< double > MeasKey
Key type used to access the slot measurement.
Definition: slots.h:74
FluxSlotDefinition defApFlux
Definition: slots.h:202
FluxSlotDefinition defModelFlux
Definition: slots.h:204
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:123
FluxSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;PsfFlux&quot;)
Definition: slots.h:78
An aggregate containing all of the current slots used in SourceTable.
Definition: slots.h:200
Key< double > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:75
bool isValid() const
Return true if the key was initialized to valid offset.
Definition: Key.h:83
FluxSlotDefinition defCalibFlux
Definition: slots.h:205
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:115
geom::ellipses::Quadrupole MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:156
std::string getAlias() const
Return the alias field prefix used to lookup Keys for the slot.
Definition: slots.h:60
CovarianceMatrixKey< float, 2 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:117
double ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:73
std::string getName() const
Return the name of the slot (e.g. &quot;Centroid&quot; or &quot;PsfFlux&quot;)
Definition: slots.h:53
CentroidSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;Centroid&quot;)
Definition: slots.h:120
double MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:72
bool isValid() const
Return True if both the x and y Keys are valid.
Definition: aggregates.h:97
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:129
ShapeSlotDefinition defShape
Definition: slots.h:207
FluxSlotDefinition defPsfFlux
Definition: slots.h:201
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:132
Key specialization for Flag.
Definition: Flag.h:84
geom::Point2D MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:114
Class for storing generic metadata.
Definition: PropertySet.h:82
SlotDefinition specialization for centroids.
Definition: slots.h:111
void handleAliasChange(std::string const &alias, Schema const &schema)
Handle a callback from an AliasMap informing the table that an alias has changed. ...
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:174
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:126
ShapeSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;Shape&quot;)
Definition: slots.h:162
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
CovarianceMatrixKey< float, 3 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:159
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:81
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:87
SlotSuite(Schema const &schema)
Initialize the slots.
void setKeys(std::string const &alias, Schema const &schema)
Update the cached Keys following an change of aliases in the given Schema.
CentroidSlotDefinition defCentroid
Definition: slots.h:206
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:168
FluxSlotDefinition defInstFlux
Definition: slots.h:203
SlotDefinition specialization for shapes.
Definition: slots.h:153
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys...
Definition: aggregates.h:188
SlotDefinition specialization for fluxes.
Definition: slots.h:69
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:90
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:157
Base class for helper classes that define slots on SourceTable/SourceRecord.
Definition: slots.h:46