lsst.jointcal  16.0+1
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 
16 public:
20 
22  TwoTransfoMapping(TwoTransfoMapping const &) = delete;
26 
28  unsigned getNpar() const;
29 
30  void getMappingIndices(std::vector<unsigned> &indices) const;
31 
33  void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const;
35  void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const;
36 
43  void offsetParams(Eigen::VectorXd const &delta) {
44  _m1->offsetParams(delta.segment(_m1->getIndex(), _m1->getNpar()));
45  _m2->offsetParams(delta.segment(_m2->getIndex() + _m1->getNpar(), _m2->getNpar()));
46  }
47 
49  Gtransfo const &getTransfo1() const { return _m1->getTransfo(); }
50 
52  Gtransfo const &getTransfo2() const { return _m2->getTransfo(); }
53 
55  void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const;
56 
58  void freezeErrorTransform();
59 
60 private:
63  void setWhatToFit(const bool fittingT1, const bool fittingT2);
64 
66  unsigned _nPar1, _nPar2;
67  struct tmpVars // just there to get around constness issues
68  {
69  Eigen::MatrixX2d h1, h2;
70  Eigen::Matrix2d dt2dx;
71  };
72 
74 };
75 } // namespace jointcal
76 } // namespace lsst
77 
78 #endif // LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
Currently not implemented.
A point in a plane.
Definition: Point.h:13
The mapping with two transfos in a row.
void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
Actually applies the AstrometryMapping and evaluates the derivatives w.r.t the fitted parameters...
A Point with uncertainties.
Definition: FatPoint.h:11
unsigned getNpar() const
Number of parameters in total.
Class for a simple mapping implementing a generic Gtransfo.
TwoTransfoMapping(std::shared_ptr< SimpleGtransfoMapping > chipMapping, std::shared_ptr< SimpleGtransfoMapping > visitMapping)
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:10
void freezeErrorTransform()
Currently not implemented.
void getMappingIndices(std::vector< unsigned > &indices) const
Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has ...
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:42
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
TwoTransfoMapping & operator=(TwoTransfoMapping const &)=delete
virtual class needed in the abstraction of the distortion model
This is the model used to fit mappings as the combination of a transformation depending on the chip n...
Gtransfo const & getTransfo1() const
access to transfos
Gtransfo const & getTransfo2() const
access to transfos
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.