gastro  0.1.0
 All Classes Files Functions Variables Pages
chip.h
1 #ifndef CHIP__H
2 #define CHIP__H
3 
4 
5 
6 #include <gtransfo.h>
7 #include <frame.h>
8 #include <countedref.h>
9 
10 #include <geomparam.h>
11 
12 class CcdImage;
13 
14 
17 
21 class Chip : public GeomParam{
22  private :
23  // what we gonna fit
24  Gtransfo *fittedTransfo;
25 
26  const Gtransfo *CTP2TP;
27  Gtransfo *ctp2Pix;
28  Gtransfo *tP2Pix;
29 
30  /* in principle useless. but reduces numerical problems
31  when fitting polynomials */
32  GtransfoLinShift shiftInTangentPlane;
33 
34 
35  void update_transfos();
36 
37  int index; // provided and retrieved by AstromFit.
38 
39 
40  public :
41 
42  Chip(const CcdImage &ccdImage, const int DistortionDegree);
43 
45  int NGroups() const {return 1;}
46 
48  int Npar(const int IGroup) const
49  { if (IGroup) {}; return (fittedTransfo)? fittedTransfo->Npar() : 0;}
50 
52 
53  int Index(const int IGroup) const
54  { if (IGroup) {}; return index;}
55 
57  void SetIndex(const int &I, const int IGroup)
58  { if (IGroup) {}; index = I;};
59 
61  void ComputeH(const Point &Where, const int IGroup, double *H) const;
62 
64  void OffsetParams(const double *ParOffsets, const int IGroup);
65 
66 
68  Point CTP2Pix(const Point &PointInCTP) const;
69 
71  virtual const Gtransfo* CTP2PixTransfo() const { return ctp2Pix;};
72 
73 
74 
76  void CTP2PixDerivative(const Point &Where, double *HxHy) const;
77 
78  ~Chip()
79  {
80  delete fittedTransfo;
81  delete ctp2Pix;
82  delete tP2Pix;
83  }
84 
85 
86 };
87 
88 
89 #include <list>
90 
91 typedef CountedRef<Chip> ChipRef;
92 typedef std::list<CountedRef<Chip> > ChipList;
93 typedef ChipList::iterator ChipIterator;
94 typedef ChipList::const_iterator ChipCIterator;
95 
96 
97 
98 
99 #endif /* CHIP__H */
virtual const Gtransfo * CTP2PixTransfo() const
transfo from CTP to pixel space
Definition: chip.h:71
Point CTP2Pix(const Point &PointInCTP) const
transform from CTP to pixel space
Definition: chip.cc:95
int Index(const int IGroup) const
where they are in the parameter std::vector
Definition: chip.h:53
handler of an actual image from a single CCD
Definition: ccdimage.h:21
void ComputeH(const Point &Where, const int IGroup, double *H) const
derivatives at positions in CommonTangentPlane w.r.t parameters. (When Igroup == 1, derivative w.r.t position itself.
Definition: chip.cc:80
void SetIndex(const int &I, const int IGroup)
assign the index
Definition: chip.h:57
handles the transfos to go from a given image to the system used to fit.
Definition: chip.h:21
int Npar(const int IGroup) const
the number of parameters to fit
Definition: chip.h:48
void OffsetParams(const double *ParOffsets, const int IGroup)
offsetparameters
Definition: chip.cc:113