35 : _m1(chipMapping), _m2(visitMapping) {
40 setWhatToFit(
true,
true);
47 if (indices.
size() < npar) indices.
resize(npar);
50 _m1->getMappingIndices(indices);
52 _m2->getMappingIndices(indices);
58 _m2->getMappingIndices(ind2);
59 for (Eigen::Index k = 0; k < _nPar2; ++k) indices.
at(k + _nPar1) = ind2.
at(k);
71 _m1->computeTransformAndDerivatives(where, pMid, tmp->h1);
73 _m2->positionDerivative(pMid, tmp->dt2dx, 1e-4);
74 H.block(0, 0, _nPar1, 2) = tmp->h1 * tmp->dt2dx;
76 _m1->transformPosAndErrors(where, pMid);
78 _m2->computeTransformAndDerivatives(pMid, outPoint, tmp->h2);
79 H.block(_nPar1, 0, _nPar2, 2) = tmp->h2;
81 _m2->transformPosAndErrors(pMid, outPoint);
88void ChipVisitAstrometryMapping::setWhatToFit(
const bool fittingT1,
const bool fittingT2) {
90 _nPar1 = _m1->getNpar();
95 _nPar2 = _m2->getNpar();
103 _m1->transformPosAndErrors(where, pMid);
104 _m2->transformPosAndErrors(pMid, outPoint);
108 double epsilon)
const {
109 Eigen::Matrix2d d1, d2;
110 _m1->positionDerivative(where, d1, 1e-4);
112 _m1->transformPosAndErrors(where, pMid);
113 _m2->positionDerivative(pMid, d2, 1e-4);
116 derivative = d1 * d2;
121 " The routine ChipVisitAstrometryMapping::freezeErrorTransform() was thought to be "
122 "useless and is not implemented (yet)");
126 out <<
"Composed Astrometry Mapping:" <<
std::endl;
127 out <<
"Sensor f(x,y)->(u,v): " << *_m1 <<
std::endl;
128 out <<
"Visit f(u,v)->alpha,delta: " << *_m2 <<
std::endl;
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
#define LSST_EXCEPT(type,...)
std::size_t getNpar() const override
Number of parameters in total.
void getMappingIndices(IndexVector &indices) const override
Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has ...
void freezeErrorTransform()
Currently not implemented.
void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const override
Actually applies the AstrometryMapping and evaluates the derivatives w.r.t the fitted parameters.
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const override
The derivative w.r.t. position.
void print(std::ostream &out) const override
Print a string representation of the contents of this mapping, for debugging.
ChipVisitAstrometryMapping(std::shared_ptr< SimpleAstrometryMapping > chipMapping, std::shared_ptr< SimpleAstrometryMapping > visitMapping)
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const override
The same as above but without the parameter derivatives (used to evaluate chi^2)
A Point with uncertainties.
Class for a simple mapping implementing a generic AstrometryTransform.