10 #include "eigenstuff.h"
11 #include "tripletlist.h"
12 #include "distortionmodel.h"
57 std::string _WhatToFit;
58 bool _fittingDistortions, _fittingPos, _fittingRefrac, _fittingPM;
61 double _referenceColor;
63 std::vector<double> _refracCoefficient;
64 unsigned int _refracPosInMatrix;
68 unsigned int _nParDistortions;
70 unsigned int _nParTot;
71 unsigned _nMeasuredStars;
82 bool Minimize(
const std::string &WhatToFit);
86 TripletList &TList, Eigen::VectorXd &Rhs)
const;
89 TripletList &TList, Eigen::VectorXd &Rhs);
112 Chi2() : chi2(0), ndof(0) {};
113 friend std::ostream& operator << (std::ostream& s,
const Chi2 &C)
115 s <<
"Chi2/ndof : " << C.chi2 <<
'/' << C.ndof <<
'=' << C.chi2/C.ndof;
return s;
120 void AddEntry(
double Inc,
unsigned Dof,
const MeasuredStar *M)
121 {chi2+= Inc; ndof += Dof;}
123 void operator += (
const Chi2 &R)
124 {chi2 += R.chi2; ndof += R.ndof;}
139 {
return _refracCoefficient;}
143 Point TransformFittedStar(
const FittedStar &F,
144 const Gtransfo * Sky2TP,
145 const Point &RefractionVector,
146 const double RefractionCoeff,
147 const double Jd)
const;
149 template <
class ListType,
class Accum>
150 void AccumulateStatImageList(ListType &L, Accum &A)
const;
152 template <
class ImType,
class Accum>
153 void AccumulateStatImage(ImType &I, Accum &A)
const;
157 std::vector<unsigned> &Indices)
const;
Chi2 ComputeChi2() const
Returns a chi2 for the current state.
Definition: astromfit.cc:410
unsigned RemoveOutliers(const double &NSigCut)
Discards measurements contributing more than a cut, computed as <chi2>+NSigCut+rms(chi2). Returns the number of removed outliers. No refit done.
Definition: astromfit.cc:497
void AssignIndices(const std::string &WhatToFit)
Set parameter groups fixed or variable and assign indices to each parameter in the big matrix (which ...
Definition: astromfit.cc:576
Definition: astromfit.h:53
void LSDerivatives(const CcdImage &Ccd, TripletList &TList, Eigen::VectorXd &Rhs) const
Definition: astromfit.cc:100
The class that implements the relations between MeasuredStar and FittedStar.
Definition: associations.h:17
handler of an actual image from a single CCD
Definition: ccdimage.h:21
Interface class between AstromFit and an actual model for the Mapping (s) from pixels to some tangent...
Definition: distortionmodel.h:13
bool Minimize(const std::string &WhatToFit)
Does a 1 step minimization, assuming a linear model.
Definition: astromfit.cc:673
void MakeResTuple(const std::string &TupleName) const
Produces a tuple containing residuals of measurements.
Definition: astromfit.cc:746
Simple structure to accumulate Chi2 and Ndof.
Definition: astromfit.h:108
std::vector< double > RefractionCoefficients() const
access to the fitted refraction coefficients. Unit depends on scale in the tangentPlane. Degrees for an actual tangent plane.
Definition: astromfit.h:138
The objects which have been measured several times. The MeasuredStar s measuring the same object in d...
Definition: fittedstar.h:37
void OffsetParams(const Eigen::VectorXd &Delta)
Offsest the parameters by the requested quantities. The used parameter layout is the one from the las...
Definition: astromfit.cc:619
objects measured on actual images. Coordinates and uncertainties are expressed in pixel image frame...
Definition: measuredstar.h:21
AstromFit(Associations &A, DistortionModel *D)
this is the only constructor
Definition: astromfit.cc:20