lsst.jointcal  master-g52a623bc1f+4
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:
58  AstrometryFit(std::shared_ptr<Associations> associations,
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 freezeErrorScales() { _astrometryModel->freezeErrorScales(); }
95 
96  void offsetParams(Eigen::VectorXd const &delta) override;
97 
98  void saveResultTuples(std::string const &tupleName) const override;
99 
101  void makeMeasResTuple(std::string const &tupleName) const;
102 
104  void makeRefResTuple(std::string const &tupleName) const;
105 
109  void checkStuff();
110 
111 private:
112  bool _fittingDistortions, _fittingPos, _fittingRefrac, _fittingPM;
113  std::shared_ptr<AstrometryModel> _astrometryModel;
114  double _referenceColor, _sigCol; // average and r.m.s color
115  double _refractionCoefficient; // fit parameter
116  unsigned int _refracPosInMatrix; // where it stands
117  double _JDRef; // average Julian date
118 
119  // counts in parameter subsets.
120  unsigned int _nParDistortions;
121  unsigned int _nParPositions;
122  unsigned int _nParRefrac;
123 
124  double _posError; // constant term on error on position (in pixel unit)
125 
126  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
127  Eigen::VectorXd &grad,
128  MeasuredStarList const *msList = nullptr) const override;
129 
130  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
131  Eigen::VectorXd &grad) const override;
132 
133  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
134 
135  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
136 
137  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
138  std::vector<unsigned> &indices) const override;
139 
140  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const *sky2TP,
141  Point const &refractionVector, double refractionCoeff, double mjd) const;
142 
144  void accumulateStatImage(CcdImage const &ccdImage, Chi2Accumulator &accum) const;
145 };
146 } // namespace jointcal
147 } // namespace lsst
148 #endif // LSST_JOINTCAL_ASTROMETRY_FIT_H
Base class for fitters.
Definition: FitterBase.h:28
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 freezeErrorScales()
The transformations used to propagate errors are freezed to the current state.
Definition: AstrometryFit.h:94
void makeRefResTuple(std::string const &tupleName) const
Produces a tuple containing residuals of reference 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:95
AstrometryFit & operator=(AstrometryFit const &)=delete
Class for a simple mapping implementing a generic Gtransfo.
Definition: Associations.h:24
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 makeMeasResTuple(std::string const &tupleName) const
Produces a tuple containing residuals of measurement terms.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the requested quantities.
void saveResultTuples(std::string const &tupleName) const override
Save the full chi2 term per star that was used in the minimization, for debugging.
Class that handles the astrometric least squares problem.
Definition: AstrometryFit.h:55
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:22
Handler of an actual image from a single CCD.
Definition: CcdImage.h:31
void checkStuff()
DEBUGGING routine.
The objects which have been measured several times.
Definition: FittedStar.h:37