11 : _m1(chipMapping), _m2(visitMapping) {
16 setWhatToFit(
true,
true);
23 if (indices.
size() < npar) indices.
resize(npar);
26 _m1->getMappingIndices(indices);
28 _m2->getMappingIndices(indices);
34 _m2->getMappingIndices(ind2);
35 for (
unsigned k = 0; k < _nPar2; ++k) indices.
at(k + _nPar1) = ind2.
at(k);
47 _m1->computeTransformAndDerivatives(where, pMid, tmp->h1);
49 _m2->positionDerivative(pMid, tmp->dt2dx, 1e-4);
50 H.block(0, 0, _nPar1, 2) = tmp->h1 * tmp->dt2dx;
52 _m1->transformPosAndErrors(where, pMid);
54 _m2->computeTransformAndDerivatives(pMid, outPoint, tmp->h2);
55 H.block(_nPar1, 0, _nPar2, 2) = tmp->h2;
57 _m2->transformPosAndErrors(pMid, outPoint);
64 void TwoTransfoMapping::setWhatToFit(
const bool fittingT1,
const bool fittingT2) {
66 _nPar1 = _m1->getNpar();
71 _nPar2 = _m2->getNpar();
79 _m1->transformPosAndErrors(where, pMid);
80 _m2->transformPosAndErrors(pMid, outPoint);
84 double epsilon)
const {
85 Eigen::Matrix2d d1, d2;
86 _m1->positionDerivative(where, d1, 1e-4);
88 _m1->transformPosAndErrors(where, pMid);
89 _m2->positionDerivative(pMid, d2, 1e-4);
98 " The routine TwoTransfoMapping::freezeErrorTransform() was thought to be useless and is " 99 "not implemented (yet)");
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
Currently not implemented.
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.
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
void freezeErrorTransform()
Currently not implemented.
#define LSST_EXCEPT(type,...)
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 ...
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)