lsst.jointcal  master-gc935ebf72c+13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 #include <map>
8 
13 #include "lsst/jointcal/Chi2.h"
14 
15 namespace lsst {
16 namespace jointcal {
17 
18 class Associations;
19 
22 private:
23  Associations &_associations;
24  std::string _whatToFit;
25  bool _fittingModel, _fittingFluxes;
26  unsigned _nParModel, _nParTot;
27  PhotometryModel *_photometryModel;
28  int _lastNTrip; // last triplet count, used to speed up allocation
29 
30 public:
32  PhotometryFit(Associations &associations, PhotometryModel *model);
33 
55  bool minimize(const std::string &whatToFit);
56 
58  void LSDerivatives(TripletList &tripletList, Eigen::VectorXd &rhs) const;
59 
62  void LSDerivatives(const CcdImage &ccdImage, TripletList &tripletList, Eigen::VectorXd &rhs,
63  const MeasuredStarList *measuredStarList = nullptr) const;
64 
79  void assignIndices(const std::string &whatToFit);
80 
89  void offsetParams(const Eigen::VectorXd &delta);
90 
94  Chi2 computeChi2() const;
95 
97  void makeResTuple(const std::string &tupleName) const;
98 
99 private:
100  template <class ListType, class Accum>
101  void accumulateStat(ListType &listType, Accum &accum) const;
102 
103  void outliersContributions(MeasuredStarList &outliers, TripletList &tripletList, Eigen::VectorXd &grad);
104 
105  void findOutliers(double nSigCut, MeasuredStarList &outliers) const;
106 
107  void getMeasuredStarIndices(const MeasuredStar &measuredStar, std::vector<unsigned> &indices) const;
108 
109 #ifdef STORAGE
110  void LSDerivatives2(TripletList &tripletList, Eigen::VectorXd &rhs) const;
112 
114 
116  unsigned removeOutliers(double nSigCut);
117 
119  void makeMeasResTuple(const std::string &tupleName) const;
120 
122  void makeRefResTuple(const std::string &tupleName) const;
123 
124 private:
125  Point transformFittedStar(const FittedStar &fittedStar, const Gtransfo *sky2TP,
126  const Point &refractionVector, double refractionCoeff, double mjd) const;
127 
129  void getMeasuredStarIndices(const MeasuredStar &measuredStar, std::vector<unsigned> &indices) const;
130 #endif
131 };
132 } // namespace jointcal
133 } // namespace lsst
134 #endif // LSST_JOINTCAL_PHOTOMETRY_FIT_H
Chi2 computeChi2() const
Returns a chi2 for the current state.
void LSDerivatives(TripletList &tripletList, Eigen::VectorXd &rhs) const
Derivatives of the Chi2.
A point in a plane.
Definition: Point.h:13
bool minimize(const std::string &whatToFit)
Does a 1 step minimization, assuming a linear model.
The class that implements the relations between MeasuredStar and FittedStar.
Definition: Associations.h:28
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:71
void assignIndices(const std::string &whatToFit)
Set parameter groups fixed or variable and assign indices to each parameter in the big matrix (which ...
Simple structure to accumulate Chi2 and Ndof.
Definition: Chi2.h:13
PhotometryFit(Associations &associations, PhotometryModel *model)
this is the only constructor
objects measured on actual images.
Definition: MeasuredStar.h:18
Class that handles the photometric least squares problem.
Definition: PhotometryFit.h:21
Interface class for PhotometryFit.
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
void makeResTuple(const std::string &tupleName) const
Produces an ntuple.
Handler of an actual image from a single CCD.
Definition: CcdImage.h:31
void offsetParams(const Eigen::VectorXd &delta)
Offset the parameters by the requested quantities.
The objects which have been measured several times.
Definition: FittedStar.h:34