lsst.jointcal  16.0-21-g96865c2+1
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 
105  std::shared_ptr<AstrometryModel> getModel() const { return _astrometryModel; }
106 
110  void checkStuff();
111 
112 private:
113  bool _fittingDistortions, _fittingPos, _fittingRefrac, _fittingPM;
114  std::shared_ptr<AstrometryModel> _astrometryModel;
115  double _referenceColor, _sigCol; // average and r.m.s color
116  double _refractionCoefficient; // fit parameter
117  unsigned int _refracPosInMatrix; // where it stands
118  double _JDRef; // average Julian date
119 
120  // counts in parameter subsets.
121  unsigned int _nParDistortions;
122  unsigned int _nParPositions;
123  unsigned int _nParRefrac;
124 
125  double _posError; // constant term on error on position (in pixel unit)
126 
127  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
128  Eigen::VectorXd &grad,
129  MeasuredStarList const *msList = nullptr) const override;
130 
131  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
132  Eigen::VectorXd &grad) const override;
133 
134  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
135 
136  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
137 
138  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
139  std::vector<unsigned> &indices) const override;
140 
141  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const &sky2TP,
142  Point const &refractionVector, double refractionCoeff, double mjd) const;
143 
145  void accumulateStatImage(CcdImage const &ccdImage, Chi2Accumulator &accum) const;
146 };
147 } // namespace jointcal
148 } // namespace lsst
149 #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:30
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::createCcdImage.
Definition: MeasuredStar.h:118
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:99
objects measured on actual images.
Definition: MeasuredStar.h:19
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:42
std::shared_ptr< AstrometryModel > getModel() const
Return the model being fit.
Handler of an actual image from a single CCD.
Definition: CcdImage.h:41
void checkStuff()
DEBUGGING routine.
The objects which have been measured several times.
Definition: FittedStar.h:37