39 indices[k] =
index + k;
44 transform->transformPosAndErrors(where, outPoint);
46 errorProp->transformPosAndErrors(where, tmp);
53 double epsilon)
const {
55 derivative(0, 0) =
lin->getCoefficient(1, 0, 0);
62 derivative(1, 0) =
lin->getCoefficient(0, 1, 0);
63 derivative(0, 1) =
lin->getCoefficient(1, 0, 1);
64 derivative(1, 1) =
lin->getCoefficient(0, 1, 1);
68 Eigen::MatrixX2d &H)
const {
70 transform->paramDerivatives(where, &H(0, 0), &H(0, 1));
89 assert((&H(1, 0) - &H(0, 0)) == 1);
93 double epsilon)
const {
96 derivative(0, 0) =
lin->getCoefficient(1, 0, 0);
103 derivative(1, 0) =
lin->getCoefficient(0, 1, 0);
104 derivative(0, 1) =
lin->getCoefficient(1, 0, 1);
105 derivative(1, 1) =
lin->getCoefficient(0, 1, 1);
106 derivative = preDer * derivative;
110 Eigen::MatrixX2d &H)
const {
113 transform->transformPosAndErrors(mid, outPoint);
115 errorProp->transformPosAndErrors(mid, tmp);
116 outPoint.
vx = tmp.
vx;
117 outPoint.
vy = tmp.
vy;
119 transform->paramDerivatives(mid, &H(0, 0), &H(0, 1));
125 transform->transformPosAndErrors(mid, outPoint);
127 errorProp->transformPosAndErrors(mid, tmp);
128 outPoint.
vx = tmp.
vx;
129 outPoint.
vy = tmp.
vy;
135 const auto *fittedPoly =
137 actualResult = (*fittedPoly) * _centerAndScale;
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
A Point with uncertainties.
Class for a simple mapping implementing a generic AstrometryTransform.
std::shared_ptr< AstrometryTransform > errorProp
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 print(std::ostream &out) const override
Print a string representation of the contents of this mapping, for debugging.
std::size_t getNpar() const override
Number of parameters in total.
std::shared_ptr< AstrometryTransform > transform
void getMappingIndices(IndexVector &indices) const override
Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has ...
std::unique_ptr< AstrometryTransformLinear > lin
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const override
The same as above but without the parameter derivatives (used to evaluate chi^2)
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const override
The derivative w.r.t. position.
void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const override
Calls the transforms and implements the centering and scaling of coordinates.
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const override
The derivative w.r.t. position.
SimplePolyMapping(AstrometryTransformLinear CenterAndScale, AstrometryTransformPolynomial const &transform)
The transformation will be initialized to transform, so that the effective transformation reads trans...
AstrometryTransform const & getTransform() const override
Access to the (fitted) transform.
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const override
The same as above but without the parameter derivatives (used to evaluate chi^2)