gastro  0.1.0
All Classes Files Functions Variables Pages
old_astromfit.h
1 #ifndef ASTROMFIT__H
2 #define ASTROMFIT__H
3 
4 #include <string>
5 #include <iostream>
6 #include <map>
7 
8 #include "ccdimage.h"
9 #include "chip.h"
10 
11 class Associations;
12 class Vect;
13 
14 
15 enum FitKind { Total=0, FlipFlop=1};
16 
17 
18 class AstromFit {
19  private :
20 
21  Associations &assoc;
22  const CcdImageList &ccdImageList;
23  FittedStarList &fittedStarList;
24 
25  unsigned int nParChips;
26  unsigned int nParStars;
27  unsigned int nParTot;
28  // chi2 stuff
29  double chi2_measured, chi2_ref;
30  int n_measured, n_ref;
31  int maxNGroups;
32 
33  std::map<const CcdImage*, GeomParam*> imageParamMap;
34 
35  void SetGeomParam(const CcdImage &C, GeomParam &G);
36 
37  void update_geom_params(Vect &B);
38 
39  void minimize_independant_geom_params();
40 
41  bool DoOneStep();
42 
43  bool FlipFlopStep();
44 
45  bool UpdateParams();
46 
47  public :
49 
51  bool Minimize(const FitKind, const int MaxIter =0);
52 
54  void SetStarIndexes();
56  double ComputeChi2();
58  void PrintChi2(const std::string &Message) const;
59 
61  GeomParam & GetGeomParam(const CcdImage & ccdImage) const;
62 
63 
64 
66  void SaveResults(const std::string &Tag);
67 
68 };
69 
70 
71 #endif /* ASTROMFIT__H */
Chi2 ComputeChi2() const
Returns a chi2 for the current state.
Definition: astromfit.cc:410
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: fittedstar.h:158
Definition: astromfit.h:53
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
bool Minimize(const std::string &WhatToFit)
Does a 1 step minimization, assuming a linear model.
Definition: astromfit.cc:673
AstromFit(Associations &A, DistortionModel *D)
this is the only constructor
Definition: astromfit.cc:20