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::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: