lsst.jointcal  16.0-20-g17d57d5+4
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:
39  FittedStar() : BaseStar(), _indexInMatrix(-1), _measurementCount(0), _refStar(nullptr) {}
40 
41  FittedStar(const BaseStar& baseStar)
42  : BaseStar(baseStar), _indexInMatrix(0), _measurementCount(0), _refStar(nullptr) {}
43 
45  FittedStar(const MeasuredStar& measuredStar);
46 
49  FittedStar(FittedStar const&) = default;
50  FittedStar(FittedStar&&) = delete;
51  FittedStar& operator=(FittedStar const&) = delete;
52  FittedStar& operator=(FittedStar&&) = delete;
53 
56  _indexInMatrix = -1;
57  _measurementCount = 0;
58  _refStar = nullptr;
59  _flux = 0;
60  _fluxErr = 0;
61  _mag = 0;
62  _magErr = 0;
63  }
64 
66  void dump(std::ostream& stream = std::cout) const {
67  BaseStar::dump(stream);
68  stream << " mcount: " << _measurementCount;
69  }
70 
72  int getMeasurementCount() const { return _measurementCount; }
73  int& getMeasurementCount() { return _measurementCount; }
74 
76  void addMagMeasurement(double magValue, double magWeight);
77 
79  void setIndexInMatrix(const unsigned& index) { _indexInMatrix = index; };
80 
82  int getIndexInMatrix() const { return _indexInMatrix; }
83 
85  void setRefStar(const RefStar* _refStar);
86 
88  const RefStar* getRefStar() const { return _refStar; };
89 
90 private:
91  unsigned _indexInMatrix;
92  int _measurementCount;
93  const RefStar* _refStar;
94 };
95 
96 /****** FittedStarList */
97 
99 class FittedStarList : public StarList<FittedStar> {
100 public:
102 
104  FittedStarList() { inTangentPlaneCoordinates = true; }
105 };
106 
107 typedef FittedStarList::const_iterator FittedStarCIterator;
108 typedef FittedStarList::iterator FittedStarIterator;
109 
112 const BaseStarList& Fitted2Base(const FittedStarList& This);
113 const BaseStarList* Fitted2Base(const FittedStarList* This);
114 } // namespace jointcal
115 } // namespace lsst
116 
117 #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:59
objects whose position is going to be fitted. Coordinates in Common Tangent Plane.
Definition: FittedStar.h:22
int getMeasurementCount() const
Definition: FittedStar.h:72
FittedStarList::const_iterator FittedStarCIterator
Definition: FittedStar.h:107
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:27
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:79
Class for a simple mapping implementing a generic Gtransfo.
FittedStarList::iterator FittedStarIterator
Definition: FittedStar.h:108
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:99
objects measured on actual images.
Definition: MeasuredStar.h:19
void dump(std::ostream &stream=std::cout) const
utility
Definition: FittedStar.h:66
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:40
const RefStar * getRefStar() const
Get the astrometric reference star associated with this star.
Definition: FittedStar.h:88
int getIndexInMatrix() const
Definition: FittedStar.h:82
STL class.
The objects which have been measured several times.
Definition: FittedStar.h:37
FittedStar(const BaseStar &baseStar)
Definition: FittedStar.h:41