lsst.jointcal  master-gc935ebf72c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
34 class FittedStar : public BaseStar, public PmBlock {
35  friend class PhotometryFit;
36  friend class PhotometryFit2;
37 
38 private:
39  double _mag;
40  double _emag;
41  double _col;
42  int _gen;
43  double _wmag;
44  unsigned _indexInMatrix;
45  int _measurementCount;
46  const RefStar* _refStar;
47 
48  double _flux2;
49  double _fluxErr;
50  double _fluxErr2;
51 
52 public:
54  : BaseStar(),
55  _mag(-1),
56  _emag(-1),
57  _col(0.),
58  _gen(-1),
59  _wmag(0),
60  _indexInMatrix(-1),
61  _measurementCount(0),
62  _refStar(nullptr),
63  _fluxErr(-1),
64  _fluxErr2(-1) {}
65 
66  FittedStar(const BaseStar& baseStar)
67  : BaseStar(baseStar),
68  _mag(-1),
69  _emag(-1),
70  _col(0.),
71  _gen(-1),
72  _wmag(0),
73  _indexInMatrix(0),
74  _measurementCount(0),
75  _refStar(nullptr),
76  _flux2(-1),
77  _fluxErr(-1),
78  _fluxErr2(-1) {}
79 
81  FittedStar(const MeasuredStar& measuredStar);
82 
85  _indexInMatrix = -1;
86  _measurementCount = 0;
87  _refStar = nullptr;
88  _wmag = 0;
89  }
90 
92  void dump(std::ostream& stream = std::cout) const {
93  BaseStar::dump(stream);
94  stream << " mcount: " << _measurementCount;
95  }
96 
98  int getMeasurementCount() const { return _measurementCount; }
99  int& getMeasurementCount() { return _measurementCount; }
100 
102  double getMag() const { return _mag; }
103  double getEMag() const { return _emag; }
104  double getCol() const { return _col; }
105  int getGeneration() const { return _gen; }
106 
108  void setMag(double mag) { _mag = mag; }
109 
111  void addMagMeasurement(double magValue, double magWeight);
112 
114  void setIndexInMatrix(const unsigned& index) { _indexInMatrix = index; };
115 
117  int getIndexInMatrix() const { return _indexInMatrix; }
118 
120  void setRefStar(const RefStar* _refStar);
121 
123  const RefStar* getRefStar() const { return _refStar; };
124 
126  double getFluxErr() const { return _fluxErr; }
127  double getFlux2() const { return _flux2; }
128  double getFluxErr2() const { return _fluxErr2; }
129 };
130 
131 /****** FittedStarList */
132 
134 class FittedStarList : public StarList<FittedStar> {
135 public:
137 
140 };
141 
142 typedef FittedStarList::const_iterator FittedStarCIterator;
143 typedef FittedStarList::iterator FittedStarIterator;
144 
147 const BaseStarList& Fitted2Base(const FittedStarList& This);
148 const BaseStarList* Fitted2Base(const FittedStarList* This);
149 } // namespace jointcal
150 } // namespace lsst
151 
152 #endif // LSST_JOINTCAL_FITTED_STAR_H
Objects used as position anchors, typically USNO stars.
Definition: RefStar.h:16
double getFluxErr2() const
Definition: FittedStar.h:128
const RefStar * getRefStar() const
Get the astrometric reference star associated with this star.
Definition: FittedStar.h:123
double getEMag() const
Definition: FittedStar.h:103
objects whose position is going to be fitted. Coordinates in Common Tangent Plane.
Definition: FittedStar.h:22
void addMagMeasurement(double magValue, double magWeight)
this routine will hopefully soon disappear.
Definition: FittedStar.cc:45
double getFluxErr() const
getters
Definition: FittedStar.h:126
double getMag() const
derived using available zero points in input images. In the absence ofZP, ZP= 0.
Definition: FittedStar.h:102
FittedStarList::const_iterator FittedStarCIterator
Definition: FittedStar.h:142
int getGeneration() const
Definition: FittedStar.h:105
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:26
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:114
void setRefStar(const RefStar *_refStar)
Set the astrometric reference star associated with this star.
Definition: FittedStar.cc:34
int getIndexInMatrix() const
Definition: FittedStar.h:117
FittedStarList::iterator FittedStarIterator
Definition: FittedStar.h:143
void setMag(double mag)
Definition: FittedStar.h:108
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:134
double getCol() const
Definition: FittedStar.h:104
objects measured on actual images.
Definition: MeasuredStar.h:18
Class that handles the photometric least squares problem.
Definition: PhotometryFit.h:21
virtual void dump(std::ostream &stream=std::cout) const
utility
Definition: BaseStar.h:57
friend class PhotometryFit2
Definition: FittedStar.h:36
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:52
int getMeasurementCount() const
Definition: FittedStar.h:98
void dump(std::ostream &stream=std::cout) const
utility
Definition: FittedStar.h:92
double getFlux2() const
Definition: FittedStar.h:127
The objects which have been measured several times.
Definition: FittedStar.h:34
FittedStar(const BaseStar &baseStar)
Definition: FittedStar.h:66