lsst.jointcal  master-gc5b79683b0+3
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:
23  PhotometryFit(std::shared_ptr<Associations> associations,
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 
55  void saveResultTuples(std::string const &tupleName) const override;
56 
57 private:
58  bool _fittingModel, _fittingFluxes;
59  std::shared_ptr<PhotometryModel> _photometryModel;
60 
61  // counts in parameter subsets.
62  unsigned int _nParModel;
63  unsigned int _nParFluxes;
64 
65  void accumulateStatImageList(CcdImageList const &ccdImageList, Chi2Accumulator &accum) const override;
66 
67  void accumulateStatRefStars(Chi2Accumulator &accum) const override;
68 
69  void getIndicesOfMeasuredStar(MeasuredStar const &measuredStar,
70  std::vector<unsigned> &indices) const override;
71 
72  void leastSquareDerivativesMeasurement(CcdImage const &ccdImage, TripletList &tripletList,
73  Eigen::VectorXd &grad,
74  MeasuredStarList const *measuredStarList = nullptr) const override;
75 
77  void leastSquareDerivativesReference(FittedStarList const &fittedStarList, TripletList &tripletList,
78  Eigen::VectorXd &grad) const override;
79 
80 #ifdef STORAGE
81  void makeMeasResTuple(std::string const &tupleName) const;
83 
85  void makeRefResTuple(std::string const &tupleName) const;
86 
87  Point transformFittedStar(FittedStar const &fittedStar, Gtransfo const *sky2TP,
88  Point const &refractionVector, double refractionCoeff, double mjd) const;
89 #endif
90 };
91 } // namespace jointcal
92 } // namespace lsst
93 #endif // LSST_JOINTCAL_PHOTOMETRY_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
PhotometryFit & operator=(PhotometryFit const &)=delete
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:113
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the requested quantities.
Class for a simple mapping implementing a generic Gtransfo.
Definition: Associations.h:24
void saveResultTuples(std::string const &tupleName) const override
Save the full chi2 term per star that was used in the minimization, for debugging.
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
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:23
Handler of an actual image from a single CCD.
Definition: CcdImage.h:34
The objects which have been measured several times.
Definition: FittedStar.h:37