2 #ifndef LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H 3 #define LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H 53 for (
unsigned k = 0; k <
getNpar(); ++k) indices[k] =
index + k;
58 transfo->transformPosAndErrors(where, outPoint);
60 errorProp->transformPosAndErrors(where, tmp);
69 derivative(0, 0) =
lin->coeff(1, 0, 0);
76 derivative(1, 0) =
lin->coeff(0, 1, 0);
77 derivative(0, 1) =
lin->coeff(1, 0, 1);
78 derivative(1, 1) =
lin->coeff(0, 1, 1);
95 transfo->paramDerivatives(where, &H(0, 0), &H(0, 1));
134 preDer(0, 0) = _centerAndScale.coeff(1, 0, 0);
135 preDer(1, 0) = _centerAndScale.coeff(0, 1, 0);
136 preDer(0, 1) = _centerAndScale.coeff(1, 0, 1);
137 preDer(1, 1) = _centerAndScale.coeff(0, 1, 1);
141 assert((&H(1, 0) - &H(0, 0)) == 1);
154 Point tmp = _centerAndScale.apply(where);
156 derivative(0, 0) =
lin->coeff(1, 0, 0);
163 derivative(1, 0) =
lin->coeff(0, 1, 0);
164 derivative(0, 1) =
lin->coeff(1, 0, 1);
165 derivative(1, 1) =
lin->coeff(0, 1, 1);
166 derivative = preDer * derivative;
176 _centerAndScale.transformPosAndErrors(where, mid);
177 transfo->transformPosAndErrors(mid, outPoint);
179 errorProp->transformPosAndErrors(mid, tmp);
180 outPoint.
vx = tmp.
vx;
181 outPoint.
vy = tmp.
vy;
183 transfo->paramDerivatives(mid, &H(0, 0), &H(0, 1));
189 _centerAndScale.transformPosAndErrors(where, mid);
190 transfo->transformPosAndErrors(mid, outPoint);
192 errorProp->transformPosAndErrors(mid, tmp);
193 outPoint.
vx = tmp.
vx;
194 outPoint.
vy = tmp.
vy;
202 actualResult = (*fittedPoly) * _centerAndScale;
211 Eigen::Matrix2d preDer;
232 #endif // LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H virtual void freezeErrorTransform()
implements the linear transformations (6 real coefficients).
SimpleGtransfoMapping & operator=(SimpleGtransfoMapping const &)=delete
Mapping implementation for a polynomial transformation.
virtual Gtransfo const & getTransfo() const
Access to the (fitted) transfo.
SimplePolyMapping(GtransfoLin const &CenterAndScale, GtransfoPoly const >ransfo)
The transformation will be initialized to gtransfo, so that the effective transformation reads gtrans...
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
The derivative w.r.t. position.
Polynomial transformation class.
A Point with uncertainties.
unsigned getNpar() const
Number of parameters in total.
void setToBeFit(bool value)
Set whether this Mapping is to be fit as part of a Model.
Class for a simple mapping implementing a generic Gtransfo.
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
Implements as well the centering and scaling of coordinates.
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.
void setIndex(unsigned i)
virtual 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...
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
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 ...
unsigned getIndex() const
position of the parameters within the grand fitting scheme
SimpleGtransfoMapping(Gtransfo const >ransfo, bool toBeFit=true)
virtual void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
Calls the transforms and implements the centering and scaling of coordinates.
a virtual (interface) class for geometric transformations.
Gtransfo const & getTransfo() const
Access to the (fitted) transfo.
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
The derivative w.r.t. position.
virtual class needed in the abstraction of the distortion model
bool getToBeFit() const
Get whether this mapping is fit as part of a Model.
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
std::unique_ptr< GtransfoLin > lin
std::shared_ptr< Gtransfo > errorProp
std::shared_ptr< Gtransfo > transfo