LSSTApplications  16.0-10-g4f78f78+16,16.0-10-gc1446dd+42,16.0-11-g09ed895+1,16.0-13-g7649090,16.0-14-g0a28612+1,16.0-14-g6c7ed55+16,16.0-15-ga29f190+1,16.0-16-g89065d4+14,16.0-16-gd8e3590+16,16.0-16-ge6a35c8+6,16.0-17-g7e0e4ff+10,16.0-17-ga3d2e9f,16.0-19-gb830ed4e+16,16.0-2-g0febb12+21,16.0-2-g9d5294e+61,16.0-2-ga8830df+5,16.0-24-gc1c7f52+9,16.0-25-g07af9f2+1,16.0-3-ge00e371+21,16.0-36-g07840cb1,16.0-4-g18f3627+5,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+16,16.0-4-gade8416+9,16.0-4-gb13d127+5,16.0-5-g6a53317+21,16.0-5-gb3f8a4b+74,16.0-5-gef99c9f+12,16.0-6-g9321be7+4,16.0-6-gcbc7b31+22,16.0-6-gf49912c+16,16.0-63-gae20905ba,16.0-7-gd2eeba5+31,16.0-8-g21fd5fe+16,16.0-8-g3a9f023+12,16.0-8-g4734f7a,16.0-9-g85d1a16+16,16.0-9-gf5c1f43,master-g07ce7b41a7,w.2018.48
LSSTDataManagementBasePackage
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.
A base class for image defects.
Definition: cameraGeom.dox:3
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.