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