LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Public Member Functions | Protected Attributes | List of all members
lsst::jointcal::SimpleAstrometryMapping Class Reference

#include <SimpleAstrometryMapping.h>

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

Public Member Functions

 SimpleAstrometryMapping (AstrometryTransform const &astrometryTransform, bool toBeFit=true)
 
 SimpleAstrometryMapping (SimpleAstrometryMapping const &)=delete
 No copy or move: there is only ever one instance of a given mapping (i.e.. per ccd+visit) More...
 
 SimpleAstrometryMapping (SimpleAstrometryMapping &&)=delete
 
SimpleAstrometryMappingoperator= (SimpleAstrometryMapping const &)=delete
 
SimpleAstrometryMappingoperator= (SimpleAstrometryMapping &&)=delete
 
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 transformPosAndErrors (FatPoint const &where, FatPoint &outPoint) const
 The same as above but without the parameter derivatives (used to evaluate chi^2) More...
 
void positionDerivative (Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
 The derivative w.r.t. position. 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)
 
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. More...
 
virtual AstrometryTransform const & getTransform () const
 Access to the (fitted) transform. More...
 
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

Definition at line 42 of file SimpleAstrometryMapping.h.

Constructor & Destructor Documentation

◆ SimpleAstrometryMapping() [1/3]

lsst::jointcal::SimpleAstrometryMapping::SimpleAstrometryMapping ( AstrometryTransform const &  astrometryTransform,
bool  toBeFit = true 
)
inline

Definition at line 44 of file SimpleAstrometryMapping.h.

45  : toBeFit(toBeFit),
48  lin(new AstrometryTransformLinear) {
49  // in this order:
50  // take a copy of the input transform,
51  // assign the transformation used to propagate errors to the transform itself
52  // reserve some memory space to compute the derivatives (efficiency).
53  }
std::shared_ptr< AstrometryTransform > transform
std::unique_ptr< AstrometryTransformLinear > lin
std::shared_ptr< AstrometryTransform > errorProp

◆ SimpleAstrometryMapping() [2/3]

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

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

◆ SimpleAstrometryMapping() [3/3]

lsst::jointcal::SimpleAstrometryMapping::SimpleAstrometryMapping ( SimpleAstrometryMapping &&  )
delete

Member Function Documentation

◆ computeTransformAndDerivatives()

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

Actually applies the AstrometryMapping and evaluates the derivatives w.r.t the fitted parameters.

This is grouped into a single call because for most models, evaluating the derivatives w.r.T parameters is not much longer than just transforming

Implements lsst::jointcal::AstrometryMapping.

Reimplemented in lsst::jointcal::SimplePolyMapping.

Definition at line 118 of file SimpleAstrometryMapping.h.

119  {
120  transformPosAndErrors(where, outPoint);
121  transform->paramDerivatives(where, &H(0, 0), &H(0, 1));
122  }
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)

◆ freezeErrorTransform()

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

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
inline

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
inlinevirtual

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
inlinevirtual

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
inline

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

Definition at line 128 of file SimpleAstrometryMapping.h.

◆ getTransform()

virtual AstrometryTransform const& lsst::jointcal::SimpleAstrometryMapping::getTransform ( ) const
inlinevirtual

Access to the (fitted) transform.

Reimplemented in lsst::jointcal::SimplePolyMapping.

Definition at line 125 of file SimpleAstrometryMapping.h.

125 { return *transform; }
std::shared_ptr< AstrometryTransform > transform

◆ offsetParams()

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

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]

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

◆ operator=() [2/2]

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

◆ positionDerivative()

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

The derivative w.r.t. position.

Implements lsst::jointcal::AstrometryMapping.

Reimplemented in lsst::jointcal::SimplePolyMapping.

Definition at line 93 of file SimpleAstrometryMapping.h.

93  {
94  errorProp->computeDerivative(where, *lin, epsilon);
95  derivative(0, 0) = lin->coeff(1, 0, 0);
96  //
97  /* This does not work : it was proved by rotating the frame
98  see the compilation switch ROTATE_T2 in constrainedAstrometryModel.cc
99  derivative(1,0) = lin->coeff(1,0,1);
100  derivative(0,1) = lin->coeff(0,1,0);
101  */
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);
105  }
std::unique_ptr< AstrometryTransformLinear > lin
std::shared_ptr< AstrometryTransform > errorProp

◆ setIndex()

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

Definition at line 116 of file SimpleAstrometryMapping.h.

◆ setToBeFit()

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

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::SimpleAstrometryMapping::transformPosAndErrors ( FatPoint const &  where,
FatPoint outPoint 
) const
inlinevirtual

The same as above but without the parameter derivatives (used to evaluate chi^2)

Implements lsst::jointcal::AstrometryMapping.

Reimplemented in lsst::jointcal::SimplePolyMapping.

Definition at line 83 of file SimpleAstrometryMapping.h.

83  {
84  transform->transformPosAndErrors(where, outPoint);
85  FatPoint tmp;
86  errorProp->transformPosAndErrors(where, tmp);
87  outPoint.vx = tmp.vx;
88  outPoint.vy = tmp.vy;
89  outPoint.vxy = tmp.vxy;
90  }
std::shared_ptr< AstrometryTransform > errorProp

Member Data Documentation

◆ errorProp

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

Definition at line 140 of file SimpleAstrometryMapping.h.

◆ index

Eigen::Index lsst::jointcal::SimpleAstrometryMapping::index
protected

Definition at line 135 of file SimpleAstrometryMapping.h.

◆ lin

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

Definition at line 143 of file SimpleAstrometryMapping.h.

◆ toBeFit

bool lsst::jointcal::SimpleAstrometryMapping::toBeFit
protected

Definition at line 134 of file SimpleAstrometryMapping.h.

◆ transform

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

Definition at line 138 of file SimpleAstrometryMapping.h.


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