LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
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
7namespace lsst {
8
9namespace daf {
10namespace base {
11class PropertySet;
12}
13} // namespace daf
14
15namespace afw {
16
17namespace fits {
18class Fits;
19}; // namespace fits
20
21namespace table {
22
48public:
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
68protected:
70};
71
74public:
75 using MeasValue = double;
76 using ErrValue = double;
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
112
113private:
114 MeasKey _measKey;
115 ErrKey _errKey;
116 Key<Flag> _flagKey;
117};
118
121public:
123 using ErrValue = Eigen::Matrix<float, 2, 2>;
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
160private:
161 MeasKey _measKey;
162 ErrKey _errKey;
163 Key<Flag> _flagKey;
164};
165
168public:
170 using ErrValue = Eigen::Matrix<float, 3, 3>;
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
206
207private:
208 MeasKey _measKey;
209 ErrKey _errKey;
210 Key<Flag> _flagKey;
211};
212
219struct 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
table::Key< std::string > name
Definition: Amplifier.cc:116
table::Schema schema
Definition: python.h:134
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
SlotDefinition specialization for centroids.
Definition: slots.h:120
CentroidSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Centroid")
Definition: slots.h:128
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:123
CentroidSlotDefinition & operator=(CentroidSlotDefinition const &)=default
CentroidSlotDefinition(CentroidSlotDefinition const &)=default
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:140
CentroidSlotDefinition & operator=(CentroidSlotDefinition &&)=default
CentroidSlotDefinition(CentroidSlotDefinition &&)=default
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:137
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:131
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:134
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
SlotDefinition specialization for fluxes.
Definition: slots.h:73
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:93
FluxSlotDefinition & operator=(FluxSlotDefinition const &)=default
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:84
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:87
double ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:76
FluxSlotDefinition & operator=(FluxSlotDefinition &&)=default
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
double MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:75
FluxSlotDefinition(FluxSlotDefinition &&)=default
FluxSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "PsfFlux")
Definition: slots.h:81
FluxSlotDefinition(FluxSlotDefinition const &)=default
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:90
bool isValid() const noexcept
Return true if the key was initialized to valid offset.
Definition: Key.h:97
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
Definition: aggregates.h:104
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys.
Definition: aggregates.h:362
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:422
Defines the fields and offsets for a table.
Definition: Schema.h:51
SlotDefinition specialization for shapes.
Definition: slots.h:167
ShapeSlotDefinition(ShapeSlotDefinition const &)=default
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:170
ShapeSlotDefinition & operator=(ShapeSlotDefinition &&)=default
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
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:184
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:181
ShapeSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Shape")
Definition: slots.h:175
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:187
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:178
ShapeSlotDefinition & operator=(ShapeSlotDefinition const &)=default
ShapeSlotDefinition(ShapeSlotDefinition &&)=default
Base class for helper classes that define slots on SourceTable/SourceRecord.
Definition: slots.h:47
std::string getName() const
Return the name of the slot (e.g. "Centroid" or "PsfFlux")
Definition: slots.h:53
SlotDefinition & operator=(SlotDefinition &&)=default
SlotDefinition & operator=(SlotDefinition const &)=default
SlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. "Centroid" or "PsfFlux")
Definition: slots.h:50
SlotDefinition(SlotDefinition &&)=default
std::string getAlias() const
Return the alias field prefix used to lookup Keys for the slot.
Definition: slots.h:60
SlotDefinition(SlotDefinition const &)=default
Class for storing generic metadata.
Definition: PropertySet.h:66
PointKey< double > Point2DKey
Definition: aggregates.h:118
Point< double, 2 > Point2D
Definition: Point.h:324
An aggregate containing all of the current slots used in SourceTable.
Definition: slots.h:219
CentroidSlotDefinition defCentroid
Definition: slots.h:225
FluxSlotDefinition defModelFlux
Definition: slots.h:223
FluxSlotDefinition defCalibFlux
Definition: slots.h:224
FluxSlotDefinition defApFlux
Definition: slots.h:221
FluxSlotDefinition defPsfFlux
Definition: slots.h:220
ShapeSlotDefinition defShape
Definition: slots.h:226
FluxSlotDefinition defGaussianFlux
Definition: slots.h:222
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