42 tmp = std::make_unique<tmpVars>();
43 setWhatToFit(
true,
true);
50 if (indices.
size() < npar) indices.
resize(npar);
53 _m1->getMappingIndices(indices);
55 _m2->getMappingIndices(indices);
61 _m2->getMappingIndices(ind2);
62 for (Eigen::Index k = 0; k < _nPar2; ++k) indices.
at(k + _nPar1) = ind2.
at(k);
74 _m1->computeTransformAndDerivatives(where, pMid, tmp->h1);
76 _m2->positionDerivative(pMid, tmp->dt2dx, 1e-4);
77 H.block(0, 0, _nPar1, 2) = tmp->h1 * tmp->dt2dx;
79 _m1->transformPosAndErrors(where, pMid);
81 _m2->computeTransformAndDerivatives(pMid, outPoint, tmp->h2);
82 H.block(_nPar1, 0, _nPar2, 2) = tmp->h2;
84 _m2->transformPosAndErrors(pMid, outPoint);
91void ChipVisitAstrometryMapping::setWhatToFit(
const bool fittingT1,
const bool fittingT2) {
93 _nPar1 = _m1->getNpar();
98 _nPar2 = _m2->getNpar();
106 _m1->transformPosAndErrors(where, pMid);
107 _m2->transformPosAndErrors(pMid, outPoint);
111 double epsilon)
const {
112 Eigen::Matrix2d d1, d2;
113 _m1->positionDerivative(where, d1, 1e-4);
115 _m1->transformPosAndErrors(where, pMid);
116 _m2->positionDerivative(pMid, d2, 1e-4);
119 derivative = d1 * d2;
124 " The routine ChipVisitAstrometryMapping::freezeErrorTransform() was thought to be "
125 "useless and is not implemented (yet)");
129 out <<
"Composed Astrometry Mapping:" <<
std::endl;
130 out <<
"Sensor f(x,y)->(u,v): " << *_m1 <<
std::endl;
131 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.