lsst.jointcal  14.0-27-ga47eb89+2
FittedStar.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_FITTED_STAR_H
3 #define LSST_JOINTCAL_FITTED_STAR_H
4 
5 #include <iostream>
6 #include <fstream>
7 
10 
11 namespace lsst {
12 namespace jointcal {
13 
14 class MeasuredStar;
15 class RefStar;
16 class Gtransfo;
17 
20 
22 struct PmBlock {
23  // proper motion in x and y. Units depend on how you fit them
24  double pmx, pmy;
25  double epmx, epmy, epmxy;
26  double color; // OK it is unrelated, but associated in practice
27  bool mightMove;
28 
29  PmBlock() : pmx(0), pmy(0), epmx(0), epmy(0), epmxy(0), color(0), mightMove(false){};
30 };
31 
37 class FittedStar : public BaseStar, public PmBlock {
38 public:
40  : BaseStar(),
41  _mag(-1),
42  _gen(-1),
43  _wmag(0),
44  _indexInMatrix(-1),
45  _measurementCount(0),
46  _refStar(nullptr) {}
47 
48  FittedStar(const BaseStar& baseStar)
49  : BaseStar(baseStar),
50  _mag(-1),
51  _gen(-1),
52  _wmag(0),
53  _indexInMatrix(0),
54  _measurementCount(0),
55  _refStar(nullptr) {}
56 
58  FittedStar(const MeasuredStar& measuredStar);
59 
62  FittedStar(FittedStar const&) = default;
63  FittedStar(FittedStar&&) = delete;
64  FittedStar& operator=(FittedStar const&) = delete;
65  FittedStar& operator=(FittedStar&&) = delete;
66 
69  _indexInMatrix = -1;
70  _measurementCount = 0;
71  _refStar = nullptr;
72  _wmag = 0;
73  }
74 
76  void dump(std::ostream& stream = std::cout) const {
77  BaseStar::dump(stream);
78  stream << " mcount: " << _measurementCount;
79  }
80 
82  int getMeasurementCount() const { return _measurementCount; }
83  int& getMeasurementCount() { return _measurementCount; }
84 
86  double getMag() const { return _mag; }
87  int getGeneration() const { return _gen; }
88 
90  void setMag(double mag) { _mag = mag; }
91 
93  void addMagMeasurement(double magValue, double magWeight);
94 
96  void setIndexInMatrix(const unsigned& index) { _indexInMatrix = index; };
97 
99  int getIndexInMatrix() const { return _indexInMatrix; }
100 
102  void setRefStar(const RefStar* _refStar);
103 
105  const RefStar* getRefStar() const { return _refStar; };
106 
107 private:
108  double _mag;
109  int _gen;
110  double _wmag;
111  unsigned _indexInMatrix;
112  int _measurementCount;
113  const RefStar* _refStar;
114 
115  double _fluxErr;
116 };
117 
118 /****** FittedStarList */
119 
121 class FittedStarList : public StarList<FittedStar> {
122 public:
124 
126  FittedStarList() { inTangentPlaneCoordinates = true; }
127 };
128 
129 typedef FittedStarList::const_iterator FittedStarCIterator;
130 typedef FittedStarList::iterator FittedStarIterator;
131 
134 const BaseStarList& Fitted2Base(const FittedStarList& This);
135 const BaseStarList* Fitted2Base(const FittedStarList* This);
136 } // namespace jointcal
137 } // namespace lsst
138 
139 #endif // LSST_JOINTCAL_FITTED_STAR_H
Objects used as position anchors, typically USNO stars.
Definition: RefStar.h:16
virtual void dump(std::ostream &stream=std::cout) const
utility
Definition: BaseStar.h:46
objects whose position is going to be fitted. Coordinates in Common Tangent Plane.
Definition: FittedStar.h:22
int getMeasurementCount() const
Definition: FittedStar.h:82
FittedStarList::const_iterator FittedStarCIterator
Definition: FittedStar.h:129
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:22
std::lists of Stars.
Definition: StarList.h:35
void setIndexInMatrix(const unsigned &index)
index is a value that a fit can set and reread....
Definition: FittedStar.h:96
Class for a simple mapping implementing a generic Gtransfo.
FittedStarList::iterator FittedStarIterator
Definition: FittedStar.h:130
void setMag(double mag)
Definition: FittedStar.h:90
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:121
objects measured on actual images.
Definition: MeasuredStar.h:18
void dump(std::ostream &stream=std::cout) const
utility
Definition: FittedStar.h:76
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:48
const RefStar * getRefStar() const
Get the astrometric reference star associated with this star.
Definition: FittedStar.h:105
int getIndexInMatrix() const
Definition: FittedStar.h:99
double getMag() const
derived using available zero points in input images. In the absence ofZP, ZP= 0.
Definition: FittedStar.h:86
STL class.
The objects which have been measured several times.
Definition: FittedStar.h:37
FittedStar(const BaseStar &baseStar)
Definition: FittedStar.h:48