LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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
void handleAliasChange(std::string const &alias, Schema const &schema)
Handle a callback from an AliasMap informing the table that an alias has changed. ...
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:45
Defines the fields and offsets for a table.
Definition: Schema.h:46
bool isValid() const
Return True if all the constituent Keys are valid.
Definition: aggregates.h:244
FluxSlotDefinition defModelFlux
Definition: slots.h:204
table::Key< std::string > name
Definition: ApCorrMap.cc:71
void setKeys(std::string const &alias, Schema const &schema)
double ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:73
void setKeys(std::string const &alias, Schema const &schema)
bool isValid() const
Return true if the key was initialized to valid offset.
Definition: Key.h:83
FluxSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;PsfFlux&quot;)
Definition: slots.h:78
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:165
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:168
ShapeSlotDefinition defShape
Definition: slots.h:207
void setKeys(std::string const &alias, Schema const &schema)
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
Definition: slots.h:157
CentroidSlotDefinition defCentroid
Definition: slots.h:206
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:171
FluxSlotDefinition defInstFlux
Definition: slots.h:203
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:129
FluxSlotDefinition defPsfFlux
Definition: slots.h:201
CentroidSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;Centroid&quot;)
Definition: slots.h:120
CovarianceMatrixKey< float, 2 > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:117
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:126
std::string getAlias() const
Definition: slots.h:60
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:132
geom::Point2D MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:114
tbl::Schema schema
bool isValid() const
Return true if the key associated with the measurement is valid.
Definition: slots.h:123
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
Key specialization for Flag.
Definition: Flag.h:82
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
Definition: slots.h:84
Class for storing generic metadata.
Definition: PropertySet.h:82
SlotDefinition specialization for centroids.
Definition: slots.h:111
double MeasValue
Type returned by accessing the slot measurement.
Definition: slots.h:72
FluxSlotDefinition defCalibFlux
Definition: slots.h:205
ShapeSlotDefinition(std::string const &name)
Construct a SlotDefinition from the name of the slot (e.g. &quot;Shape&quot;)
Definition: slots.h:162
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:90
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
Definition: slots.h:87
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
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
Definition: slots.h:174
FluxSlotDefinition defApFlux
Definition: slots.h:202
Key< double > ErrKey
Key type used to access the slot uncertainty.
Definition: slots.h:75
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
bool isValid() const
Return True if both the x and y Keys are valid.
Definition: aggregates.h:97
SlotDefinition specialization for fluxes.
Definition: slots.h:69
std::string getName() const
Return the name of the slot (e.g. &quot;Centroid&quot; or &quot;PsfFlux&quot;)
Definition: slots.h:53
Key< double > MeasKey
Key type used to access the slot measurement.
Definition: slots.h:74
QuadrupoleKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:158
SlotSuite(Schema const &schema)
Initialize the slots.
Point2DKey MeasKey
Key type used to access the slot measurement.
Definition: slots.h:116