lsst.jointcal  15.0-12-gd965ca7+2
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 
8 #include "lsst/log/Log.h"
10 #include "lsst/jointcal/CcdImage.h"
11 #include "lsst/jointcal/Chi2.h"
16 
17 namespace lsst {
18 namespace jointcal {
19 
21 class PhotometryFit : public FitterBase {
22 public:
25  std::shared_ptr<PhotometryModel> photometryModel)
26  : FitterBase(associations),
27  _fittingModel(false),
28  _fittingFluxes(false),
29  _photometryModel(photometryModel),
30  _nParModel(0),
31  _nParFluxes(0) {
32  _log = LOG_GET("jointcal.PhotometryFit");
33  }
34 
36  PhotometryFit(PhotometryFit const &) = delete;
37  PhotometryFit(PhotometryFit &&) = delete;
38  PhotometryFit &operator=(PhotometryFit const &) = delete;
40 
54  void assignIndices(std::string const &whatToFit) override;
55 
56  void offsetParams(Eigen::VectorXd const &delta) override;
57 
59  void saveChi2MeasContributions(std::string const &baseName) const override;
60 
62  void saveChi2RefContributions(std::string const &baseName) const override;
63 
64 private:
65  bool _fittingModel, _fittingFluxes;
66  std::shared_ptr<PhotometryModel> _photometryModel;
67 
68  // counts in parameter subsets.
69  unsigned int _nParModel;
70  unsigned int _nParFluxes;
71 
72  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
73 
74  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
75 
76  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
77  std::vector<unsigned> &indices) const override;
78 
79  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
80  Eigen::VectorXd &grad,
81  MeasuredStarList const *measuredStarList = nullptr) const override;
82 
84  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
85  Eigen::VectorXd &grad) const override;
86 
87 #ifdef STORAGE
88  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const *sky2TP,
89  Point const &refractionVector, double refractionCoeff, double mjd) const;
90 #endif
91 };
92 } // namespace jointcal
93 } // namespace lsst
94 #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: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
PhotometryFit & operator=(PhotometryFit const &)=delete
A list of MeasuredStar. They are usually filled in Associations::createCcdImage.
Definition: MeasuredStar.h:113
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:19
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:21
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:42
PhotometryFit(std::shared_ptr< Associations > associations, std::shared_ptr< PhotometryModel > photometryModel)
this is the only constructor
Definition: PhotometryFit.h:24
Handler of an actual image from a single CCD.
Definition: CcdImage.h:35
#define LOG_GET(logger)
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