lsst.jointcal  14.0-26-gc4bc114+6
AstrometryFit.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_ASTROMETRY_FIT_H
3 #define LSST_JOINTCAL_ASTROMETRY_FIT_H
4 
5 #include <string>
6 #include <iostream>
7 #include <sstream>
8 
10 #include "lsst/jointcal/CcdImage.h"
11 #include "lsst/jointcal/Chi2.h"
16 
17 namespace lsst {
18 namespace jointcal {
19 
55 class AstrometryFit : public FitterBase {
56 public:
59  std::shared_ptr<AstrometryModel> astrometryModel, double posError);
60 
62  AstrometryFit(AstrometryFit const &) = delete;
63  AstrometryFit(AstrometryFit &&) = delete;
64  AstrometryFit &operator=(AstrometryFit const &) = delete;
66 
85  void assignIndices(std::string const &whatToFit) override;
86 
94  void freezeErrorTransform() { _astrometryModel->freezeErrorTransform(); }
95 
96  void offsetParams(Eigen::VectorXd const &delta) override;
97 
99  void saveChi2MeasContributions(std::string const &baseName) const override;
100 
102  void saveChi2RefContributions(std::string const &baseName) const override;
103 
107  void checkStuff();
108 
109 private:
110  bool _fittingDistortions, _fittingPos, _fittingRefrac, _fittingPM;
111  std::shared_ptr<AstrometryModel> _astrometryModel;
112  double _referenceColor, _sigCol; // average and r.m.s color
113  double _refractionCoefficient; // fit parameter
114  unsigned int _refracPosInMatrix; // where it stands
115  double _JDRef; // average Julian date
116 
117  // counts in parameter subsets.
118  unsigned int _nParDistortions;
119  unsigned int _nParPositions;
120  unsigned int _nParRefrac;
121 
122  double _posError; // constant term on error on position (in pixel unit)
123 
124  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
125  Eigen::VectorXd &grad,
126  MeasuredStarList const *msList = nullptr) const override;
127 
128  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
129  Eigen::VectorXd &grad) const override;
130 
131  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
132 
133  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
134 
135  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
136  std::vector<unsigned> &indices) const override;
137 
138  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const *sky2TP,
139  Point const &refractionVector, double refractionCoeff, double mjd) const;
140 
142  void accumulateStatImage(CcdImage const &ccdImage, Chi2Accumulator &accum) const;
143 };
144 } // namespace jointcal
145 } // namespace lsst
146 #endif // LSST_JOINTCAL_ASTROMETRY_FIT_H
void saveChi2RefContributions(std::string const &baseName) const override
Save a CSV file containing residuals of reference terms.
Base class for fitters.
Definition: FitterBase.h:29
Base class for Chi2Statistic and Chi2List, to allow addEntry inside Fitter for either class...
Definition: Chi2.h:21
A point in a plane.
Definition: Point.h:13
void freezeErrorTransform()
The transformations used to propagate errors are freezed to the current state.
Definition: AstrometryFit.h:94
void saveChi2MeasContributions(std::string const &baseName) const override
Save a CSV file containing residuals of measurement terms.
void assignIndices(std::string const &whatToFit) override
Set parameters to fit and assign indices in the big matrix.
AstrometryFit(std::shared_ptr< Associations > associations, std::shared_ptr< AstrometryModel > astrometryModel, double posError)
this is the only constructor
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:112
STL class.
AstrometryFit & operator=(AstrometryFit const &)=delete
Class for a simple mapping implementing a generic Gtransfo.
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 offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the requested quantities.
Class that handles the astrometric least squares problem.
Definition: AstrometryFit.h:55
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:41
Handler of an actual image from a single CCD.
Definition: CcdImage.h:35
void checkStuff()
DEBUGGING routine.
The objects which have been measured several times.
Definition: FittedStar.h:37