LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
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  using MeasValue = double;
76  using ErrValue = double;
77  using MeasKey = Key<double>;
78  using ErrKey = Key<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 
111  ~FluxSlotDefinition() = default;
112 
113 private:
114  MeasKey _measKey;
115  ErrKey _errKey;
116  Key<Flag> _flagKey;
117 };
118 
121 public:
123  using ErrValue = Eigen::Matrix<float, 2, 2>;
124  using MeasKey = Point2DKey;
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  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 
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
table::Key< std::string > name
Definition: Amplifier.cc:116
Fits * fits
Definition: FitsWriter.cc:90
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 & operator=(CentroidSlotDefinition const &)=default
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
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:140
CentroidSlotDefinition(CentroidSlotDefinition const &)=default
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
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
FluxSlotDefinition & operator=(FluxSlotDefinition &&)=default
FluxSlotDefinition & operator=(FluxSlotDefinition const &)=default
double ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:76
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:93
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
Key specialization for Flag.
Definition: Flag.h:94
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:282
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:342
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
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:187
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
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
PointKey< double > Point2DKey
Definition: aggregates.h:118
Point< double, 2 > Point2D
Definition: Point.h:324
A base class for image defects.
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
SlotSuite(Schema const &schema)
Initialize the slots.
Definition: slots.cc:126
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