LSSTApplications  16.0-10-g4f78f78+16,16.0-10-gc1446dd+42,16.0-11-g09ed895+1,16.0-13-g7649090,16.0-14-g0a28612+1,16.0-14-g6c7ed55+16,16.0-15-ga29f190+1,16.0-16-g89065d4+14,16.0-16-gd8e3590+16,16.0-16-ge6a35c8+6,16.0-17-g7e0e4ff+10,16.0-17-ga3d2e9f,16.0-19-gb830ed4e+16,16.0-2-g0febb12+21,16.0-2-g9d5294e+61,16.0-2-ga8830df+5,16.0-24-gc1c7f52+9,16.0-25-g07af9f2+1,16.0-3-ge00e371+21,16.0-36-g07840cb1,16.0-4-g18f3627+5,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+16,16.0-4-gade8416+9,16.0-4-gb13d127+5,16.0-5-g6a53317+21,16.0-5-gb3f8a4b+74,16.0-5-gef99c9f+12,16.0-6-g9321be7+4,16.0-6-gcbc7b31+22,16.0-6-gf49912c+16,16.0-63-gae20905ba,16.0-7-gd2eeba5+31,16.0-8-g21fd5fe+16,16.0-8-g3a9f023+12,16.0-8-g4734f7a,16.0-9-g85d1a16+16,16.0-9-gf5c1f43,master-g07ce7b41a7,w.2018.48
LSSTDataManagementBasePackage
Public Member Functions | Protected Attributes | List of all members
lsst::jointcal::SimpleGtransfoMapping Class Reference

#include <SimpleAstrometryMapping.h>

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

Public Member Functions

 SimpleGtransfoMapping (Gtransfo const &gtransfo, bool toBeFit=true)
 
 SimpleGtransfoMapping (SimpleGtransfoMapping const &)=delete
 No copy or move: there is only ever one instance of a given mapping (i.e.. per ccd+visit) More...
 
 SimpleGtransfoMapping (SimpleGtransfoMapping &&)=delete
 
SimpleGtransfoMappingoperator= (SimpleGtransfoMapping const &)=delete
 
SimpleGtransfoMappingoperator= (SimpleGtransfoMapping &&)=delete
 
virtual void freezeErrorTransform ()
 
unsigned getNpar () const
 Number of parameters in total. More...
 
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 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...
 
unsigned getIndex () const
 position of the parameters within the grand fitting scheme More...
 
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. More...
 
virtual Gtransfo const & getTransfo () const
 Access to the (fitted) transfo. 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
 
unsigned index
 
std::shared_ptr< Gtransfotransfo
 
std::shared_ptr< GtransfoerrorProp
 
std::unique_ptr< GtransfoLinlin
 

Detailed Description

Definition at line 42 of file SimpleAstrometryMapping.h.

Constructor & Destructor Documentation

◆ SimpleGtransfoMapping() [1/3]

lsst::jointcal::SimpleGtransfoMapping::SimpleGtransfoMapping ( Gtransfo const &  gtransfo,
bool  toBeFit = true 
)
inline

Definition at line 44 of file SimpleAstrometryMapping.h.

45  : toBeFit(toBeFit), transfo(gtransfo.clone()), errorProp(transfo), lin(new GtransfoLin) {
46  // in this order:
47  // take a copy of the input transfo,
48  // assign the transformation used to propagate errors to the transfo itself
49  // reserve some memory space to compute the derivatives (efficiency).
50  }

◆ SimpleGtransfoMapping() [2/3]

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

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

◆ SimpleGtransfoMapping() [3/3]

lsst::jointcal::SimpleGtransfoMapping::SimpleGtransfoMapping ( SimpleGtransfoMapping &&  )
delete

Member Function Documentation

◆ computeTransformAndDerivatives()

virtual void lsst::jointcal::SimpleGtransfoMapping::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 115 of file SimpleAstrometryMapping.h.

116  {
117  transformPosAndErrors(where, outPoint);
118  transfo->paramDerivatives(where, &H(0, 0), &H(0, 1));
119  }
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::SimpleGtransfoMapping::freezeErrorTransform ( )
inlinevirtual

Definition at line 58 of file SimpleAstrometryMapping.h.

58  {
59  // from there on, updating the transfo does not change the errors.
60  errorProp = transfo->clone();
61  }

◆ getIndex()

unsigned lsst::jointcal::SimpleGtransfoMapping::getIndex ( ) const
inline

position of the parameters within the grand fitting scheme

Definition at line 110 of file SimpleAstrometryMapping.h.

◆ getMappingIndices()

void lsst::jointcal::SimpleGtransfoMapping::getMappingIndices ( std::vector< unsigned > &  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 74 of file SimpleAstrometryMapping.h.

74  {
75  if (indices.size() < getNpar()) indices.resize(getNpar());
76  for (unsigned k = 0; k < getNpar(); ++k) indices[k] = index + k;
77  }
T resize(T... args)
unsigned getNpar() const
Number of parameters in total.
T size(T... args)

◆ getNpar()

unsigned lsst::jointcal::SimpleGtransfoMapping::getNpar ( ) const
inlinevirtual

Number of parameters in total.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 66 of file SimpleAstrometryMapping.h.

66  {
67  if (toBeFit)
68  return transfo->getNpar();
69  else
70  return 0;
71  }

◆ getToBeFit()

bool lsst::jointcal::SimpleGtransfoMapping::getToBeFit ( ) const
inline

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

Definition at line 125 of file SimpleAstrometryMapping.h.

◆ getTransfo()

virtual Gtransfo const& lsst::jointcal::SimpleGtransfoMapping::getTransfo ( ) const
inlinevirtual

Access to the (fitted) transfo.

Reimplemented in lsst::jointcal::SimplePolyMapping.

Definition at line 122 of file SimpleAstrometryMapping.h.

122 { return *transfo; }

◆ offsetParams()

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

Remember the error scale and freeze it.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 105 of file SimpleAstrometryMapping.h.

105  {
106  if (toBeFit) transfo->offsetParams(delta);
107  }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ positionDerivative()

void lsst::jointcal::SimpleGtransfoMapping::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 90 of file SimpleAstrometryMapping.h.

90  {
91  errorProp->computeDerivative(where, *lin, epsilon);
92  derivative(0, 0) = lin->coeff(1, 0, 0);
93  //
94  /* This does not work : it was proved by rotating the frame
95  see the compilation switch ROTATE_T2 in constrainedAstrometryModel.cc
96  derivative(1,0) = lin->coeff(1,0,1);
97  derivative(0,1) = lin->coeff(0,1,0);
98  */
99  derivative(1, 0) = lin->coeff(0, 1, 0);
100  derivative(0, 1) = lin->coeff(1, 0, 1);
101  derivative(1, 1) = lin->coeff(0, 1, 1);
102  }

◆ setIndex()

void lsst::jointcal::SimpleGtransfoMapping::setIndex ( unsigned  i)
inline

Definition at line 113 of file SimpleAstrometryMapping.h.

◆ setToBeFit()

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

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

Definition at line 127 of file SimpleAstrometryMapping.h.

◆ transformPosAndErrors()

void lsst::jointcal::SimpleGtransfoMapping::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 80 of file SimpleAstrometryMapping.h.

80  {
81  transfo->transformPosAndErrors(where, outPoint);
82  FatPoint tmp;
83  errorProp->transformPosAndErrors(where, tmp);
84  outPoint.vx = tmp.vx;
85  outPoint.vy = tmp.vy;
86  outPoint.vxy = tmp.vxy;
87  }

Member Data Documentation

◆ errorProp

std::shared_ptr<Gtransfo> lsst::jointcal::SimpleGtransfoMapping::errorProp
protected

Definition at line 137 of file SimpleAstrometryMapping.h.

◆ index

unsigned lsst::jointcal::SimpleGtransfoMapping::index
protected

Definition at line 132 of file SimpleAstrometryMapping.h.

◆ lin

std::unique_ptr<GtransfoLin> lsst::jointcal::SimpleGtransfoMapping::lin
protected

Definition at line 140 of file SimpleAstrometryMapping.h.

◆ toBeFit

bool lsst::jointcal::SimpleGtransfoMapping::toBeFit
protected

Definition at line 131 of file SimpleAstrometryMapping.h.

◆ transfo

std::shared_ptr<Gtransfo> lsst::jointcal::SimpleGtransfoMapping::transfo
protected

Definition at line 135 of file SimpleAstrometryMapping.h.


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