lsst.jointcal  16.0-24-gd8faad8
TwoTransfoMapping.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 /*
3  * This file is part of jointcal.
4  *
5  * Developed for the LSST Data Management System.
6  * This product includes software developed by the LSST Project
7  * (https://www.lsst.org).
8  * See the COPYRIGHT file at the top-level directory of this distribution
9  * for details of code ownership.
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
25 #ifndef LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
26 #define LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
27 
28 #include "memory"
29 
33 
34 namespace lsst {
35 namespace jointcal {
36 
39 public:
43 
45  TwoTransfoMapping(TwoTransfoMapping const &) = delete;
49 
51  unsigned getNpar() const;
52 
53  void getMappingIndices(std::vector<unsigned> &indices) const;
54 
56  void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const;
58  void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const;
59 
66  void offsetParams(Eigen::VectorXd const &delta) {
67  _m1->offsetParams(delta.segment(_m1->getIndex(), _m1->getNpar()));
68  _m2->offsetParams(delta.segment(_m2->getIndex() + _m1->getNpar(), _m2->getNpar()));
69  }
70 
72  Gtransfo const &getTransfo1() const { return _m1->getTransfo(); }
73 
75  Gtransfo const &getTransfo2() const { return _m2->getTransfo(); }
76 
78  void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const;
79 
81  void freezeErrorTransform();
82 
83 private:
86  void setWhatToFit(const bool fittingT1, const bool fittingT2);
87 
89  unsigned _nPar1, _nPar2;
90  struct tmpVars // just there to get around constness issues
91  {
92  Eigen::MatrixX2d h1, h2;
93  Eigen::Matrix2d dt2dx;
94  };
95 
97 };
98 } // namespace jointcal
99 } // namespace lsst
100 
101 #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:36
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:34
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:33
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:65
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.