lsst.jointcal  14.0-31-gde643ac+1
Public Member Functions | List of all members
lsst::jointcal::GtransfoPoly Class Reference

Polynomial transformation class. More...

#include <Gtransfo.h>

Inheritance diagram for lsst::jointcal::GtransfoPoly:
lsst::jointcal::Gtransfo lsst::jointcal::GtransfoLin lsst::jointcal::GtransfoLinRot lsst::jointcal::GtransfoLinScale lsst::jointcal::GtransfoLinShift

Public Member Functions

 GtransfoPoly (const unsigned degree=1)
 Default transfo : identity for all degrees (>=1 ). More...
 
 GtransfoPoly (const Gtransfo *gtransfo, const Frame &frame, unsigned degree, unsigned nPoint=1000)
 Constructs a "polynomial image" from an existing transfo, over a specified domain. More...
 
void setDegree (const unsigned degree)
 
void apply (const double xIn, const double yIn, double &xOut, double &yOut) const
 
void computeDerivative (const Point &where, GtransfoLin &derivative, const double step=0.01) const
 specialised analytic routine More...
 
virtual void transformPosAndErrors (const FatPoint &in, FatPoint &out) const
 a mix of apply and Derivative More...
 
unsigned getDegree () const
 returns degree More...
 
int getNpar () const
 total number of parameters More...
 
void dump (std::ostream &stream=std::cout) const
 print out of coefficients in a readable form. More...
 
double fit (const StarMatchList &starMatchList)
 guess what More...
 
GtransfoPoly operator* (const GtransfoPoly &right) const
 Composition (internal stuff in quadruple precision) More...
 
GtransfoPoly operator+ (const GtransfoPoly &right) const
 Addition. More...
 
GtransfoPoly operator- (const GtransfoPoly &right) const
 Subtraction. More...
 
std::unique_ptr< GtransforeduceCompo (const Gtransfo *right) const
 to be overloaded by derived classes if they can really "reduce" the composition (e.g. More...
 
std::unique_ptr< Gtransfoclone () const
 returns a copy (allocated by new) of the transformation. More...
 
double coeff (const unsigned powX, const unsigned powY, const unsigned whichCoord) const
 access to coefficients (read only) More...
 
double & coeff (const unsigned powX, const unsigned powY, const unsigned whichCoord)
 write access More...
 
double coeffOrZero (const unsigned powX, const unsigned powY, const unsigned whichCoord) const
 read access, zero if beyond degree More...
 
double determinant () const
 
double paramRef (const int i) const
 
double & paramRef (const int i)
 
void paramDerivatives (const Point &where, double *dx, double *dy) const
 Derivative w.r.t parameters. More...
 
void write (std::ostream &s) const
 
void read (std::istream &s)
 
void apply (const Point &in, Point &out) const
 applies the tranfo to in and writes into out. Is indeed virtual. More...
 
Point apply (const Point &in) const
 All these apply(..) shadow the virtual one in derived classes, unless one writes "using Gtransfo::apply". More...
 
std::string __str__ ()
 
void transformStar (FatPoint &in) const
 allows to write MyTransfo(MyStar) More...
 
virtual double getJacobian (const Point &point) const
 returns the local jacobian. More...
 
virtual double getJacobian (const double x, const double y) const
 returns the local jacobian. More...
 
virtual GtransfoLin linearApproximation (const Point &where, const double step=0.01) const
 linear (local) approximation. More...
 
virtual void transformErrors (const Point &where, const double *vIn, double *vOut) const
 transform errors (represented as double[3] in order V(xx),V(yy),Cov(xy)) More...
 
virtual std::unique_ptr< GtransfoinverseTransfo (const double precision, const Frame &region) const
 returns an inverse transfo. Numerical if not overloaded. More...
 
void getParams (double *params) const
 params should be at least Npar() long More...
 
void offsetParams (Eigen::VectorXd const &delta)
 
virtual std::unique_ptr< GtransforoughInverse (const Frame &region) const
 Rough inverse. More...
 
void write (const std::string &fileName) const
 

Detailed Description

Polynomial transformation class.

Definition at line 195 of file Gtransfo.h.

Constructor & Destructor Documentation

◆ GtransfoPoly() [1/2]

lsst::jointcal::GtransfoPoly::GtransfoPoly ( const unsigned  degree = 1)

Default transfo : identity for all degrees (>=1 ).

Default transfo : identity for all degrees (>=1 )

The degree refers to the highest total power (x+y) of monomials.

Definition at line 409 of file Gtransfo.cc.

◆ GtransfoPoly() [2/2]

lsst::jointcal::GtransfoPoly::GtransfoPoly ( const Gtransfo gtransfo,
const Frame frame,
unsigned  degree,
unsigned  nPoint = 1000 
)

Constructs a "polynomial image" from an existing transfo, over a specified domain.

Definition at line 422 of file Gtransfo.cc.

Member Function Documentation

◆ __str__()

std::string lsst::jointcal::Gtransfo::__str__ ( )
inlineinherited

Definition at line 60 of file Gtransfo.h.

◆ apply() [1/3]

void lsst::jointcal::Gtransfo::apply ( const Point in,
Point out 
) const
inlineinherited

applies the tranfo to in and writes into out. Is indeed virtual.

Definition at line 47 of file Gtransfo.h.

◆ apply() [2/3]

Point lsst::jointcal::Gtransfo::apply ( const Point in) const
inlineinherited

All these apply(..) shadow the virtual one in derived classes, unless one writes "using Gtransfo::apply".

Definition at line 51 of file Gtransfo.h.

◆ apply() [3/3]

void lsst::jointcal::GtransfoPoly::apply ( const double  xIn,
const double  yIn,
double &  xOut,
double &  yOut 
) const
virtual

Implements lsst::jointcal::Gtransfo.

Definition at line 486 of file Gtransfo.cc.

◆ clone()

std::unique_ptr<Gtransfo> lsst::jointcal::GtransfoPoly::clone ( ) const
inlinevirtual

returns a copy (allocated by new) of the transformation.

Implements lsst::jointcal::Gtransfo.

Reimplemented in lsst::jointcal::GtransfoLin.

Definition at line 240 of file Gtransfo.h.

◆ coeff() [1/2]

double lsst::jointcal::GtransfoPoly::coeff ( const unsigned  powX,
const unsigned  powY,
const unsigned  whichCoord 
) const

access to coefficients (read only)

Definition at line 651 of file Gtransfo.cc.

◆ coeff() [2/2]

double & lsst::jointcal::GtransfoPoly::coeff ( const unsigned  powX,
const unsigned  powY,
const unsigned  whichCoord 
)

write access

Definition at line 659 of file Gtransfo.cc.

◆ coeffOrZero()

double lsst::jointcal::GtransfoPoly::coeffOrZero ( const unsigned  powX,
const unsigned  powY,
const unsigned  whichCoord 
) const

read access, zero if beyond degree

Definition at line 664 of file Gtransfo.cc.

◆ computeDerivative()

void lsst::jointcal::GtransfoPoly::computeDerivative ( const Point where,
GtransfoLin derivative,
const double  step = 0.01 
) const
virtual

specialised analytic routine

Reimplemented from lsst::jointcal::Gtransfo.

Reimplemented in lsst::jointcal::GtransfoLin.

Definition at line 509 of file Gtransfo.cc.

◆ determinant()

double lsst::jointcal::GtransfoPoly::determinant ( ) const

Definition at line 719 of file Gtransfo.cc.

◆ dump()

void lsst::jointcal::GtransfoPoly::dump ( std::ostream stream = std::cout) const
virtual

print out of coefficients in a readable form.

Implements lsst::jointcal::Gtransfo.

Definition at line 703 of file Gtransfo.cc.

◆ fit()

double lsst::jointcal::GtransfoPoly::fit ( const StarMatchList starMatchList)
virtual

guess what

Implements lsst::jointcal::Gtransfo.

Reimplemented in lsst::jointcal::GtransfoLinRot, and lsst::jointcal::GtransfoLinShift.

Definition at line 817 of file Gtransfo.cc.

◆ getDegree()

unsigned lsst::jointcal::GtransfoPoly::getDegree ( ) const
inline

returns degree

Definition at line 218 of file Gtransfo.h.

◆ getJacobian() [1/2]

virtual double lsst::jointcal::Gtransfo::getJacobian ( const Point point) const
inlinevirtualinherited

returns the local jacobian.

Definition at line 77 of file Gtransfo.h.

◆ getJacobian() [2/2]

double lsst::jointcal::Gtransfo::getJacobian ( const double  x,
const double  y 
) const
virtualinherited

returns the local jacobian.

Definition at line 57 of file Gtransfo.cc.

◆ getNpar()

int lsst::jointcal::GtransfoPoly::getNpar ( ) const
inlinevirtual

total number of parameters

Reimplemented from lsst::jointcal::Gtransfo.

Reimplemented in lsst::jointcal::GtransfoLinScale, lsst::jointcal::GtransfoLinRot, and lsst::jointcal::GtransfoLinShift.

Definition at line 221 of file Gtransfo.h.

◆ getParams()

void lsst::jointcal::Gtransfo::getParams ( double *  params) const
inherited

params should be at least Npar() long

Definition at line 170 of file Gtransfo.cc.

◆ inverseTransfo()

std::unique_ptr< Gtransfo > lsst::jointcal::Gtransfo::inverseTransfo ( const double  precision,
const Frame region 
) const
virtualinherited

returns an inverse transfo. Numerical if not overloaded.

precision and region refer to the "input" side of this, and hence to the output side of the returned Gtransfo.

Reimplemented in lsst::jointcal::TanRaDec2Pix, lsst::jointcal::TanSipPix2RaDec, lsst::jointcal::TanPix2RaDec, lsst::jointcal::GtransfoLin, and lsst::jointcal::GtransfoInverse.

Definition at line 252 of file Gtransfo.cc.

◆ linearApproximation()

GtransfoLin lsst::jointcal::Gtransfo::linearApproximation ( const Point where,
const double  step = 0.01 
) const
virtualinherited

linear (local) approximation.

Reimplemented in lsst::jointcal::GtransfoLin, and lsst::jointcal::GtransfoIdentity.

Definition at line 93 of file Gtransfo.cc.

◆ offsetParams()

void lsst::jointcal::Gtransfo::offsetParams ( Eigen::VectorXd const &  delta)
inherited

Definition at line 175 of file Gtransfo.cc.

◆ operator*()

GtransfoPoly lsst::jointcal::GtransfoPoly::operator* ( const GtransfoPoly right) const

Composition (internal stuff in quadruple precision)

Definition at line 944 of file Gtransfo.cc.

◆ operator+()

GtransfoPoly lsst::jointcal::GtransfoPoly::operator+ ( const GtransfoPoly right) const

Addition.

Definition at line 965 of file Gtransfo.cc.

◆ operator-()

GtransfoPoly lsst::jointcal::GtransfoPoly::operator- ( const GtransfoPoly right) const

Subtraction.

Definition at line 978 of file Gtransfo.cc.

◆ paramDerivatives()

void lsst::jointcal::GtransfoPoly::paramDerivatives ( const Point where,
double *  dx,
double *  dy 
) const
virtual

Derivative w.r.t parameters.

Derivatives should be al least 2*NPar long. first Npar, for x, last Npar for y.

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 683 of file Gtransfo.cc.

◆ paramRef() [1/2]

double lsst::jointcal::GtransfoPoly::paramRef ( const int  i) const
virtual

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 673 of file Gtransfo.cc.

◆ paramRef() [2/2]

double & lsst::jointcal::GtransfoPoly::paramRef ( const int  i)
virtual

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 678 of file Gtransfo.cc.

◆ read()

void lsst::jointcal::GtransfoPoly::read ( std::istream s)

Definition at line 998 of file Gtransfo.cc.

◆ reduceCompo()

std::unique_ptr< Gtransfo > lsst::jointcal::GtransfoPoly::reduceCompo ( const Gtransfo right) const
virtual

to be overloaded by derived classes if they can really "reduce" the composition (e.g.

composition of Polynomial can be reduced)

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 835 of file Gtransfo.cc.

◆ roughInverse()

std::unique_ptr< Gtransfo > lsst::jointcal::Gtransfo::roughInverse ( const Frame region) const
virtualinherited

Rough inverse.

Stored by the numerical inverter to guess starting point for the trials. Just here to enable overloading.

Reimplemented in lsst::jointcal::TanRaDec2Pix, lsst::jointcal::TanPix2RaDec, and lsst::jointcal::GtransfoInverse.

Definition at line 150 of file Gtransfo.cc.

◆ setDegree()

void lsst::jointcal::GtransfoPoly::setDegree ( const unsigned  degree)

Definition at line 465 of file Gtransfo.cc.

◆ transformErrors()

void lsst::jointcal::Gtransfo::transformErrors ( const Point where,
const double *  vIn,
double *  vOut 
) const
virtualinherited

transform errors (represented as double[3] in order V(xx),V(yy),Cov(xy))

Definition at line 117 of file Gtransfo.cc.

◆ transformPosAndErrors()

void lsst::jointcal::GtransfoPoly::transformPosAndErrors ( const FatPoint in,
FatPoint out 
) const
virtual

a mix of apply and Derivative

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 567 of file Gtransfo.cc.

◆ transformStar()

void lsst::jointcal::Gtransfo::transformStar ( FatPoint in) const
inlineinherited

allows to write MyTransfo(MyStar)

Definition at line 74 of file Gtransfo.h.

◆ write() [1/2]

void lsst::jointcal::Gtransfo::write ( const std::string fileName) const
inherited

Definition at line 199 of file Gtransfo.cc.

◆ write() [2/2]

void lsst::jointcal::GtransfoPoly::write ( std::ostream s) const
virtual

Reimplemented from lsst::jointcal::Gtransfo.

Definition at line 988 of file Gtransfo.cc.


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