lsst.jointcal  master-gc935ebf72c+13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TwoTransfoMapping.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
3 #define LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
4 
5 #include "memory"
6 
10 
11 namespace lsst {
12 namespace jointcal {
13 
15 class TwoTransfoMapping : public Mapping {
16  SimpleGtransfoMapping *_m1, *_m2;
17  unsigned _nPar1, _nPar2;
18  struct tmpVars // just there to get around constness issues
19  {
20  Eigen::MatrixX2d h1, h2;
21  Eigen::Matrix2d dt2dx;
22  };
23 
24  std::unique_ptr<tmpVars> tmp;
25 
26  // forbid copies
28  void operator=(const TwoTransfoMapping &);
29 
30 public:
34  unsigned getNpar() const;
35 
36  void setMappingIndices(std::vector<unsigned> &indices) const;
37 
39  void computeTransformAndDerivatives(const FatPoint &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const;
41  void transformPosAndErrors(const FatPoint &where, FatPoint &outPoint) const;
42 
44  void offsetParams(const double *delta) { // this routine is not used when fitting. used for debugging
45  _m1->offsetParams(delta);
46  _m2->offsetParams(delta + _m1->getNpar());
47  }
48 
50  const Gtransfo &getTransfo1() const { return _m1->getTransfo(); }
51 
53  const Gtransfo &getTransfo2() const { return _m2->getTransfo(); }
54 
56  void positionDerivative(const Point &where, Eigen::Matrix2d &derivative, double epsilon) const;
57 
59  void freezeErrorScales();
60 
61 private:
62  friend class ConstrainedPolyModel;
64  void setWhatToFit(const bool fittingT1, const bool fittingT2);
65 };
66 } // namespace jointcal
67 } // namespace lsst
68 
69 #endif // LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
virtual class needed in the abstraction of the distortion model
Definition: Mapping.h:15
A point in a plane.
Definition: Point.h:13
const Gtransfo & getTransfo2() const
access to transfos
The mapping with two transfos in a row.
void offsetParams(const double *delta)
Remember the error scale and freeze it.
unsigned getNpar() const
Number of parameters in total.
void offsetParams(const double *delta)
Remember the error scale and freeze it.
A Point with uncertainties.
Definition: FatPoint.h:11
virtual const Gtransfo & getTransfo() const
Access to the (fitted) transfo.
const Gtransfo & getTransfo1() const
access to transfos
This is the model used to fit mappings as the combination of a transformation depending on the chip n...
void setMappingIndices(std::vector< unsigned > &indices) const
Sets how this set of parameters (of length Npar()) map into the &quot;grand&quot; fit Expects that indices has ...
void freezeErrorScales()
Currently not implemented.
unsigned getNpar() const
Number of parameters in total.
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:6
void positionDerivative(const Point &where, Eigen::Matrix2d &derivative, double epsilon) const
Currently not implemented.
void transformPosAndErrors(const FatPoint &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
void computeTransformAndDerivatives(const FatPoint &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
Actually applies the mapping and evaluates the derivatives w.r.t the fitted parameters.