LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | Protected Attributes | List of all members
lsst::jointcal::SimplePolyMapping Class Reference

Mapping implementation for a polynomial transformation. More...

#include <SimpleAstrometryMapping.h>

Inheritance diagram for lsst::jointcal::SimplePolyMapping:
lsst::jointcal::SimpleAstrometryMapping lsst::jointcal::AstrometryMapping

Public Member Functions

 ~SimplePolyMapping ()
 
 SimplePolyMapping (AstrometryTransformLinear const &CenterAndScale, AstrometryTransformPolynomial const &transform)
 The transformation will be initialized to transform, so that the effective transformation reads transform*CenterAndScale. More...
 
 SimplePolyMapping (SimplePolyMapping const &)=delete
 No copy or move: there is only ever one instance of a given mapping (i.e.. per ccd+visit) More...
 
 SimplePolyMapping (SimplePolyMapping &&)=delete
 
SimplePolyMappingoperator= (SimplePolyMapping const &)=delete
 
SimplePolyMappingoperator= (SimplePolyMapping &&)=delete
 
void positionDerivative (Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
 The derivative w.r.t. position. More...
 
virtual void computeTransformAndDerivatives (FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
 Calls the transforms and implements the centering and scaling of coordinates. More...
 
void transformPosAndErrors (FatPoint const &where, FatPoint &outPoint) const
 Implements as well the centering and scaling of coordinates. More...
 
AstrometryTransform const & getTransform () const
 Access to the (fitted) transform. More...
 
virtual void freezeErrorTransform ()
 
std::size_t getNpar () const
 Number of parameters in total. More...
 
void getMappingIndices (IndexVector &indices) const
 Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has enough space reserved. More...
 
void offsetParams (Eigen::VectorXd const &delta)
 Remember the error scale and freeze it. More...
 
Eigen::Index getIndex () const
 position of the parameters within the grand fitting scheme More...
 
void setIndex (Eigen::Index i)
 
bool getToBeFit () const
 Get whether this mapping is fit as part of a Model. More...
 
void setToBeFit (bool value)
 Set whether this Mapping is to be fit as part of a Model. More...
 

Protected Attributes

bool toBeFit
 
Eigen::Index index
 
std::shared_ptr< AstrometryTransformtransform
 
std::shared_ptr< AstrometryTransformerrorProp
 
std::unique_ptr< AstrometryTransformLinearlin
 

Detailed Description

Mapping implementation for a polynomial transformation.

Definition at line 147 of file SimpleAstrometryMapping.h.

Constructor & Destructor Documentation

◆ ~SimplePolyMapping()

lsst::jointcal::SimplePolyMapping::~SimplePolyMapping ( )
inline

Definition at line 149 of file SimpleAstrometryMapping.h.

149 {}

◆ SimplePolyMapping() [1/3]

lsst::jointcal::SimplePolyMapping::SimplePolyMapping ( AstrometryTransformLinear const &  CenterAndScale,
AstrometryTransformPolynomial const &  transform 
)
inline

The transformation will be initialized to transform, so that the effective transformation reads transform*CenterAndScale.

Definition at line 154 of file SimpleAstrometryMapping.h.

156  : SimpleAstrometryMapping(transform), _centerAndScale(CenterAndScale) {
157  // We assume that the initialization was done properly, for example that
158  // transform = pixToTangentPlane*CenterAndScale.inverted(), so we do not touch transform.
159  /* store the (spatial) derivative of _centerAndScale. For the extra
160  diagonal terms, just copied the ones in positionDerivatives */
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);
165 
166  // check of matrix indexing (once for all)
167  MatrixX2d H(3, 2);
168  assert((&H(1, 0) - &H(0, 0)) == 1);
169  }
double coeff(std::size_t powX, std::size_t powY, std::size_t whichCoord) const
access to coefficients (read only)
SimpleAstrometryMapping(AstrometryTransform const &astrometryTransform, bool toBeFit=true)
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:33

◆ SimplePolyMapping() [2/3]

lsst::jointcal::SimplePolyMapping::SimplePolyMapping ( SimplePolyMapping const &  )
delete

No copy or move: there is only ever one instance of a given mapping (i.e.. per ccd+visit)

◆ SimplePolyMapping() [3/3]

lsst::jointcal::SimplePolyMapping::SimplePolyMapping ( SimplePolyMapping &&  )
delete

Member Function Documentation

◆ computeTransformAndDerivatives()

virtual void lsst::jointcal::SimplePolyMapping::computeTransformAndDerivatives ( FatPoint const &  where,
FatPoint outPoint,
Eigen::MatrixX2d H 
) const
inlinevirtual

Calls the transforms and implements the centering and scaling of coordinates.

Reimplemented from lsst::jointcal::SimpleAstrometryMapping.

Definition at line 200 of file SimpleAstrometryMapping.h.

201  {
202  FatPoint mid;
203  _centerAndScale.transformPosAndErrors(where, mid);
204  transform->transformPosAndErrors(mid, outPoint);
205  FatPoint tmp;
206  errorProp->transformPosAndErrors(mid, tmp);
207  outPoint.vx = tmp.vx;
208  outPoint.vy = tmp.vy;
209  outPoint.vxy = tmp.vxy;
210  transform->paramDerivatives(mid, &H(0, 0), &H(0, 1));
211  }
std::shared_ptr< AstrometryTransform > errorProp
virtual void transformPosAndErrors(const FatPoint &in, FatPoint &out) const override
a mix of apply and Derivative

◆ freezeErrorTransform()

virtual void lsst::jointcal::SimpleAstrometryMapping::freezeErrorTransform ( )
inlinevirtualinherited

Definition at line 61 of file SimpleAstrometryMapping.h.

61  {
62  // from there on, updating the transform does not change the errors.
63  errorProp = transform->clone();
64  }
std::shared_ptr< AstrometryTransform > errorProp

◆ getIndex()

Eigen::Index lsst::jointcal::SimpleAstrometryMapping::getIndex ( ) const
inlineinherited

position of the parameters within the grand fitting scheme

Definition at line 113 of file SimpleAstrometryMapping.h.

◆ getMappingIndices()

void lsst::jointcal::SimpleAstrometryMapping::getMappingIndices ( IndexVector indices) const
inlinevirtualinherited

Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has enough space reserved.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 77 of file SimpleAstrometryMapping.h.

77  {
78  if (indices.size() < getNpar()) indices.resize(getNpar());
79  for (std::size_t k = 0; k < getNpar(); ++k) indices[k] = index + k;
80  }
std::size_t getNpar() const
Number of parameters in total.
T resize(T... args)
T size(T... args)

◆ getNpar()

std::size_t lsst::jointcal::SimpleAstrometryMapping::getNpar ( ) const
inlinevirtualinherited

Number of parameters in total.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 69 of file SimpleAstrometryMapping.h.

69  {
70  if (toBeFit)
71  return transform->getNpar();
72  else
73  return 0;
74  }

◆ getToBeFit()

bool lsst::jointcal::SimpleAstrometryMapping::getToBeFit ( ) const
inlineinherited

Get whether this mapping is fit as part of a Model.

Definition at line 128 of file SimpleAstrometryMapping.h.

◆ getTransform()

AstrometryTransform const& lsst::jointcal::SimplePolyMapping::getTransform ( ) const
inlinevirtual

Access to the (fitted) transform.

Reimplemented from lsst::jointcal::SimpleAstrometryMapping.

Definition at line 226 of file SimpleAstrometryMapping.h.

226  {
227  // Cannot fail given the contructor:
228  const AstrometryTransformPolynomial *fittedPoly =
229  dynamic_cast<const AstrometryTransformPolynomial *>(&(*transform));
230  actualResult = (*fittedPoly) * _centerAndScale;
231  return actualResult;
232  }

◆ offsetParams()

void lsst::jointcal::SimpleAstrometryMapping::offsetParams ( Eigen::VectorXd const &  delta)
inlinevirtualinherited

Remember the error scale and freeze it.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 108 of file SimpleAstrometryMapping.h.

108  {
109  if (toBeFit) transform->offsetParams(delta);
110  }

◆ operator=() [1/2]

SimplePolyMapping& lsst::jointcal::SimplePolyMapping::operator= ( SimplePolyMapping const &  )
delete

◆ operator=() [2/2]

SimplePolyMapping& lsst::jointcal::SimplePolyMapping::operator= ( SimplePolyMapping &&  )
delete

◆ positionDerivative()

void lsst::jointcal::SimplePolyMapping::positionDerivative ( Point const &  where,
Eigen::Matrix2d &  derivative,
double  epsilon 
) const
inlinevirtual

The derivative w.r.t. position.

Reimplemented from lsst::jointcal::SimpleAstrometryMapping.

Definition at line 180 of file SimpleAstrometryMapping.h.

180  {
181  Point tmp = _centerAndScale.apply(where);
182  errorProp->computeDerivative(tmp, *lin, epsilon);
183  derivative(0, 0) = lin->coeff(1, 0, 0);
184  //
185  /* This does not work : it was proved by rotating the frame
186  see the compilation switch ROTATE_T2 in constrainedAstrometryModel.cc
187  derivative(1,0) = lin->coeff(1,0,1);
188  derivative(0,1) = lin->coeff(0,1,0);
189  */
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;
194  }
void apply(const double xIn, const double yIn, double &xOut, double &yOut) const override
std::unique_ptr< AstrometryTransformLinear > lin
std::shared_ptr< AstrometryTransform > errorProp

◆ setIndex()

void lsst::jointcal::SimpleAstrometryMapping::setIndex ( Eigen::Index  i)
inlineinherited

Definition at line 116 of file SimpleAstrometryMapping.h.

◆ setToBeFit()

void lsst::jointcal::SimpleAstrometryMapping::setToBeFit ( bool  value)
inlineinherited

Set whether this Mapping is to be fit as part of a Model.

Definition at line 130 of file SimpleAstrometryMapping.h.

◆ transformPosAndErrors()

void lsst::jointcal::SimplePolyMapping::transformPosAndErrors ( FatPoint const &  where,
FatPoint outPoint 
) const
inlinevirtual

Implements as well the centering and scaling of coordinates.

Reimplemented from lsst::jointcal::SimpleAstrometryMapping.

Definition at line 214 of file SimpleAstrometryMapping.h.

214  {
215  FatPoint mid;
216  _centerAndScale.transformPosAndErrors(where, mid);
217  transform->transformPosAndErrors(mid, outPoint);
218  FatPoint tmp;
219  errorProp->transformPosAndErrors(mid, tmp);
220  outPoint.vx = tmp.vx;
221  outPoint.vy = tmp.vy;
222  outPoint.vxy = tmp.vxy;
223  }
std::shared_ptr< AstrometryTransform > errorProp
virtual void transformPosAndErrors(const FatPoint &in, FatPoint &out) const override
a mix of apply and Derivative

Member Data Documentation

◆ errorProp

std::shared_ptr<AstrometryTransform> lsst::jointcal::SimpleAstrometryMapping::errorProp
protectedinherited

Definition at line 140 of file SimpleAstrometryMapping.h.

◆ index

Eigen::Index lsst::jointcal::SimpleAstrometryMapping::index
protectedinherited

Definition at line 135 of file SimpleAstrometryMapping.h.

◆ lin

std::unique_ptr<AstrometryTransformLinear> lsst::jointcal::SimpleAstrometryMapping::lin
protectedinherited

Definition at line 143 of file SimpleAstrometryMapping.h.

◆ toBeFit

bool lsst::jointcal::SimpleAstrometryMapping::toBeFit
protectedinherited

Definition at line 134 of file SimpleAstrometryMapping.h.

◆ transform

std::shared_ptr<AstrometryTransform> lsst::jointcal::SimpleAstrometryMapping::transform
protectedinherited

Definition at line 138 of file SimpleAstrometryMapping.h.


The documentation for this class was generated from the following file: