25 #ifndef LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H 26 #define LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H 79 for (
unsigned k = 0; k <
getNpar(); ++k) indices[k] =
index + k;
84 transform->transformPosAndErrors(where, outPoint);
86 errorProp->transformPosAndErrors(where, tmp);
95 derivative(0, 0) =
lin->coeff(1, 0, 0);
102 derivative(1, 0) =
lin->coeff(0, 1, 0);
103 derivative(0, 1) =
lin->coeff(1, 0, 1);
104 derivative(1, 1) =
lin->coeff(0, 1, 1);
121 transform->paramDerivatives(where, &H(0, 0), &H(0, 1));
161 preDer(0, 0) = _centerAndScale.coeff(1, 0, 0);
162 preDer(1, 0) = _centerAndScale.coeff(0, 1, 0);
163 preDer(0, 1) = _centerAndScale.coeff(1, 0, 1);
164 preDer(1, 1) = _centerAndScale.coeff(0, 1, 1);
168 assert((&H(1, 0) - &H(0, 0)) == 1);
181 Point tmp = _centerAndScale.apply(where);
183 derivative(0, 0) =
lin->coeff(1, 0, 0);
190 derivative(1, 0) =
lin->coeff(0, 1, 0);
191 derivative(0, 1) =
lin->coeff(1, 0, 1);
192 derivative(1, 1) =
lin->coeff(0, 1, 1);
193 derivative = preDer * derivative;
203 _centerAndScale.transformPosAndErrors(where, mid);
204 transform->transformPosAndErrors(mid, outPoint);
206 errorProp->transformPosAndErrors(mid, tmp);
207 outPoint.
vx = tmp.
vx;
208 outPoint.
vy = tmp.
vy;
210 transform->paramDerivatives(mid, &H(0, 0), &H(0, 1));
216 _centerAndScale.transformPosAndErrors(where, mid);
217 transform->transformPosAndErrors(mid, outPoint);
219 errorProp->transformPosAndErrors(mid, tmp);
220 outPoint.
vx = tmp.
vx;
221 outPoint.
vy = tmp.
vy;
230 actualResult = (*fittedPoly) * _centerAndScale;
239 Eigen::Matrix2d preDer;
260 #endif // LSST_JOINTCAL_SIMPLE_ASTROMETRY_MAPPING_H SimpleAstrometryMapping & operator=(SimpleAstrometryMapping const &)=delete
std::shared_ptr< AstrometryTransform > transform
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.
SimpleAstrometryMapping(AstrometryTransform const &astrometryTransform, bool toBeFit=true)
Mapping implementation for a polynomial transformation.
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
unsigned getNpar() const
Number of parameters in total.
virtual void freezeErrorTransform()
A Point with uncertainties.
SimplePolyMapping(AstrometryTransformLinear const &CenterAndScale, AstrometryTransformPolynomial const &transform)
The transformation will be initialized to transform, so that the effective transformation reads trans...
std::unique_ptr< AstrometryTransformLinear > lin
void setIndex(unsigned i)
virtual AstrometryTransform const & getTransform() const
Access to the (fitted) transform.
A base class for image defects.
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
Implements as well the centering and scaling of coordinates.
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
std::shared_ptr< AstrometryTransform > errorProp
void setToBeFit(bool value)
Set whether this Mapping is to be fit as part of a Model.
bool getToBeFit() const
Get whether this mapping is fit as part of a Model.
virtual void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
Calls the transforms and implements the centering and scaling of coordinates.
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
The derivative w.r.t. position.
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
The derivative w.r.t. position.
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...
virtual class needed in the abstraction of the distortion model
AstrometryTransform const & getTransform() const
Access to the (fitted) transform.