lsst.jointcal  14.0-14-g932474c+5
PhotometryFit.h
Go to the documentation of this file.
1 #ifndef LSST_JOINTCAL_PHOTOMETRY_FIT_H
2 #define LSST_JOINTCAL_PHOTOMETRY_FIT_H
3 
4 #include <string>
5 #include <iostream>
6 #include <sstream>
7 
10 #include "lsst/jointcal/Chi2.h"
15 
16 namespace lsst {
17 namespace jointcal {
18 
20 class PhotometryFit : public FitterBase {
21 public:
24  std::shared_ptr<PhotometryModel> photometryModel)
25  : FitterBase(associations),
26  _fittingModel(false),
27  _fittingFluxes(false),
28  _photometryModel(photometryModel),
29  _nParModel(0),
30  _nParFluxes(0) {}
31 
33  PhotometryFit(PhotometryFit const &) = delete;
34  PhotometryFit(PhotometryFit &&) = delete;
35  PhotometryFit &operator=(PhotometryFit const &) = delete;
37 
51  void assignIndices(std::string const &whatToFit) override;
52 
53  void offsetParams(Eigen::VectorXd const &delta) override;
54 
56  void saveChi2MeasContributions(std::string const &baseName) const override;
57 
59  void saveChi2RefContributions(std::string const &baseName) const override;
60 
61 private:
62  bool _fittingModel, _fittingFluxes;
63  std::shared_ptr<PhotometryModel> _photometryModel;
64 
65  // counts in parameter subsets.
66  unsigned int _nParModel;
67  unsigned int _nParFluxes;
68 
69  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
70 
71  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
72 
73  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
74  std::vector<unsigned> &indices) const override;
75 
76  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
77  Eigen::VectorXd &grad,
78  MeasuredStarList const *measuredStarList = nullptr) const override;
79 
81  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
82  Eigen::VectorXd &grad) const override;
83 
84 #ifdef STORAGE
85  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const *sky2TP,
86  Point const &refractionVector, double refractionCoeff, double mjd) const;
87 #endif
88 };
89 } // namespace jointcal
90 } // namespace lsst
91 #endif // LSST_JOINTCAL_PHOTOMETRY_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: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
PhotometryFit & operator=(PhotometryFit const &)=delete
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:111
STL class.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the requested quantities.
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 assignIndices(std::string const &whatToFit) override
Set parameters to fit and assign indices in the big matrix.
Class that handles the photometric least squares problem.
Definition: PhotometryFit.h:20
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:39
PhotometryFit(std::shared_ptr< Associations > associations, std::shared_ptr< PhotometryModel > photometryModel)
this is the only constructor
Definition: PhotometryFit.h:23
Handler of an actual image from a single CCD.
Definition: CcdImage.h:34
void saveChi2MeasContributions(std::string const &baseName) const override
Save a CSV file containing residuals of measurement terms.
The objects which have been measured several times.
Definition: FittedStar.h:37