gastro  0.1.0
 All Classes Files Functions Variables Pages
constrainedpolymodel.h
1 #ifndef CONSTRAINEDPOLYMODEL__H
2 #define CONSTRAINEDPOLYMODEL__H
3 
4 #include "eigenstuff.h"
5 #include "simplepolymapping.h"
6 
7 class CcdImage;
8 
9 #include "distortionmodel.h"
10 #include "gtransfo.h"
11 #include "simplepolymapping.h"
12 #include "twotransfomapping.h"
13 #include <map>
14 
15 class CcdImageList;
16 
17 
18 typedef unsigned ShootIdType;
19 
21 
23 {
24  /* using ref counts here allows us to not write a destructor nor a copy
25  constructor. I could *not* get it to work using std::auto_ptr. */
26  typedef std::map<const CcdImage*, CountedRef<TwoTransfoMapping> > mappingMapType;
27  mappingMapType _mappings;
28  typedef std::map<unsigned, CountedRef<SimpleGtransfoMapping> > chipMapType;
29  chipMapType _chipMap;
30  typedef std::map<ShootIdType, CountedRef<SimpleGtransfoMapping> > shootMapType;
31  shootMapType _shootMap;
32  const ProjectionHandler* _sky2TP;
33  bool _fittingChips, _fittingShoots;
34 
35 
36 public :
38  ConstrainedPolyModel(const CcdImageList &L,
39  const ProjectionHandler* ProjH,
40  bool InitFromWCS,
41  unsigned NNotFit=0);
42 
43  // The following routines are the interface to AstromFit
45  const Mapping* GetMapping(const CcdImage &) const;
46 
48  unsigned AssignIndices(unsigned FirstIndex, std::string &WhatToFit);
49 
50  // dispaches the offsets after a fit step into the actual locations of parameters
51  void OffsetParams(const Eigen::VectorXd &Delta);
52 
54  void DumpT2Transfos() const;
55 
59  const Gtransfo* Sky2TP(const Mapping* M, const CcdImage &C) const
60  { return _sky2TP->Sky2TP(M,C);}
61 
62 };
63 
64 
65 
66 #endif /* CONSTRAINEDPOLYMODEL__H */
virtual class needed in the abstraction of the distortion model
Definition: mapping.h:13
void DumpT2Transfos() const
just a printout for now
Definition: constrainedpolymodel.cc:148
unsigned AssignIndices(unsigned FirstIndex, std::string &WhatToFit)
Positions the various parameter sets into the parameter vector, starting at FirstIndex.
Definition: constrainedpolymodel.cc:93
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
void OffsetParams(const Eigen::VectorXd &Delta)
Offset the parameters by the provided amounts.
Definition: constrainedpolymodel.cc:130
const Mapping * GetMapping(const CcdImage &) const
Mapping associated to a given CcdImage.
Definition: constrainedpolymodel.cc:83
This is a virtual class that allows a lot of freedom in the choice of the projection from "Sky" (wher...
Definition: projectionhandler.h:13
This is the model used to fit mappings as the combination of a transformation depending on the chip n...
Definition: constrainedpolymodel.h:22
const Gtransfo * Sky2TP(const Mapping *M, const CcdImage &C) const
Definition: constrainedpolymodel.h:59