lsst.jointcal ge7491f621d+f69bf0c103
Public Member Functions | List of all members
lsst::jointcal::TanRaDecToPixel Class Reference

This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) More...

#include <AstrometryTransform.h>

Inheritance diagram for lsst::jointcal::TanRaDecToPixel:
lsst::jointcal::AstrometryTransform

Public Member Functions

 TanRaDecToPixel (AstrometryTransformLinear tan2Pix, Point const &tangentPoint)
 assume degrees everywhere. More...
 
 TanRaDecToPixel ()
 
AstrometryTransformLinear getLinPart () const
 The Linear part (corresponding to CD's and CRPIX's) More...
 
void setTangentPoint (Point const &tangentPoint)
 Resets the projection (or tangent) point. More...
 
Point getTangentPoint () const
 tangent point coordinates (degrees) More...
 
void apply (double xIn, double yIn, double &xOut, double &yOut) const
 
void transformPosAndErrors (const FatPoint &in, FatPoint &out) const
 transform with analytical derivatives More...
 
TanPixelToRaDec inverted () const
 exact typed inverse: More...
 
std::unique_ptr< AstrometryTransformroughInverse (const Frame &region) const
 Overload the "generic routine" (available for all AstrometryTransform types. More...
 
std::unique_ptr< AstrometryTransforminverseTransform (double precision, const Frame &region) const
 Inverse transform: returns a TanPixelToRaDec. More...
 
void print (std::ostream &out) const
 prints the transform coefficients to stream. More...
 
std::unique_ptr< AstrometryTransformclone () const
 returns a copy (allocated by new) of the transformation. More...
 
double fit (StarMatchList const &starMatchList)
 fits a transform to a std::list of Point pairs (p1,p2, the Point fields in StarMatch). More...
 
virtual void apply (double xIn, double yIn, double &xOut, double &yOut) const=0
 
void apply (Point const &in, Point &out) const
 applies the tranfo to in and writes into out. Is indeed virtual. More...
 
Point apply (Point const &in) const
 All these apply(..) shadow the virtual one in derived classes, unless one writes "using AstrometryTransform::apply". More...
 
Frame apply (Frame const &inputframe, bool inscribed) const
 Transform a bounding box, taking either the inscribed or circumscribed box. More...
 
std::string __str__ () const
 
void transformStar (FatPoint &in) const
 
virtual double getJacobian (Point const &point) const
 returns the local jacobian. More...
 
virtual double getJacobian (double x, double y) const
 returns the local jacobian. More...
 
virtual std::unique_ptr< AstrometryTransformcomposeAndReduce (AstrometryTransform const &right) const
 Return a reduced composition of newTransform = this(right()), or nullptr if it cannot be reduced. More...
 
virtual void computeDerivative (Point const &where, AstrometryTransformLinear &derivative, double step=0.01) const
 Computes the local Derivative of a transform, w.r.t. More...
 
virtual AstrometryTransformLinear linearApproximation (Point const &where, double step=0.01) const
 linear (local) approximation. More...
 
virtual void transformErrors (Point const &where, const double *vIn, double *vOut) const
 transform errors (represented as double[3] in order V(xx),V(yy),Cov(xy)) More...
 
void getParams (double *params) const
 params should be at least Npar() long More...
 
void offsetParams (Eigen::VectorXd const &delta)
 
virtual double paramRef (Eigen::Index i) const
 
virtual double & paramRef (Eigen::Index i)
 
virtual void paramDerivatives (Point const &where, double *dx, double *dy) const
 Derivative w.r.t parameters. More...
 
virtual std::size_t getNpar () const
 returns the number of parameters (to compute chi2's) More...
 
virtual std::shared_ptr< ast::MappingtoAstMap (jointcal::Frame const &domain) const
 Create an equivalent AST mapping for this transformation, including an analytic inverse if possible. More...
 
void write (const std::string &fileName) const
 
virtual void write (std::ostream &stream) const
 

Detailed Description

This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane)

this transform does not implement corrections, since they are defined the other way around (from pixels to sky), and not invertible analytically. The inversion of tangent point WCS (TanPixelToRaDec) is obtained via inverseTransform().

Definition at line 707 of file AstrometryTransform.h.

Constructor & Destructor Documentation

◆ TanRaDecToPixel() [1/2]

lsst::jointcal::TanRaDecToPixel::TanRaDecToPixel ( AstrometryTransformLinear  tan2Pix,
Point const &  tangentPoint 
)

assume degrees everywhere.

Definition at line 1660 of file AstrometryTransform.cc.

◆ TanRaDecToPixel() [2/2]

lsst::jointcal::TanRaDecToPixel::TanRaDecToPixel ( )

Definition at line 1674 of file AstrometryTransform.cc.

Member Function Documentation

◆ __str__()

std::string lsst::jointcal::AstrometryTransform::__str__ ( ) const
inlineinherited

Definition at line 94 of file AstrometryTransform.h.

◆ apply() [1/5]

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

Implements lsst::jointcal::AstrometryTransform.

Definition at line 1737 of file AstrometryTransform.cc.

◆ apply() [2/5]

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

◆ apply() [3/5]

Frame lsst::jointcal::AstrometryTransform::apply ( Frame const &  inputframe,
bool  inscribed 
) const

Transform a bounding box, taking either the inscribed or circumscribed box.

Parameters
[in]inputframeThe frame to be transformed.
[in]inscribedReturn the inscribed (true) or circumscribed (false) box.
Returns
The transformed frame.

Definition at line 89 of file AstrometryTransform.cc.

◆ apply() [4/5]

Point lsst::jointcal::AstrometryTransform::apply ( Point const &  in) const
inline

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

Definition at line 75 of file AstrometryTransform.h.

◆ apply() [5/5]

void lsst::jointcal::AstrometryTransform::apply ( Point const &  in,
Point out 
) const
inline

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

Definition at line 71 of file AstrometryTransform.h.

◆ clone()

std::unique_ptr< AstrometryTransform > lsst::jointcal::TanRaDecToPixel::clone ( ) const
virtual

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

Implements lsst::jointcal::AstrometryTransform.

Definition at line 1776 of file AstrometryTransform.cc.

◆ composeAndReduce()

std::unique_ptr< AstrometryTransform > lsst::jointcal::AstrometryTransform::composeAndReduce ( AstrometryTransform const &  right) const
virtualinherited

Return a reduced composition of newTransform = this(right()), or nullptr if it cannot be reduced.

"Reduced" in this context means that they are capable of being merged into a single transform, for example, for two polynomials:

\[ f(x) = 1 + x^2, g(x) = -1 + 3x \]

we would have h = f.composeAndReduce(g) == 2 - 6x + 9x^2.

To be overloaded by derived classes if they can properly reduce the composition.

Parameters
rightThe transform to apply first.
Returns
The new reduced and composed AstrometryTransform, or nullptr if no such reduction is possible.

Reimplemented in lsst::jointcal::AstrometryTransformPolynomial, lsst::jointcal::TanPixelToRaDec, and lsst::jointcal::AstrometryTransformIdentity.

Definition at line 95 of file AstrometryTransform.cc.

◆ computeDerivative()

void lsst::jointcal::AstrometryTransform::computeDerivative ( Point const &  where,
AstrometryTransformLinear derivative,
double  step = 0.01 
) const
virtualinherited

Computes the local Derivative of a transform, w.r.t.

the Derivative is represented by a AstrometryTransformLinear, in which (hopefully), the offset terms are zero.

position.

Step is used for numerical derivation.

Derivative should transform a vector of offsets into a vector of offsets.

Reimplemented in lsst::jointcal::AstrometryTransformIdentity, lsst::jointcal::AstrometryTransformPolynomial, and lsst::jointcal::AstrometryTransformLinear.

Definition at line 119 of file AstrometryTransform.cc.

◆ fit()

double lsst::jointcal::TanRaDecToPixel::fit ( StarMatchList const &  starMatchList)
virtual

fits a transform to a std::list of Point pairs (p1,p2, the Point fields in StarMatch).

After the fit this(p1) yields approximately p2. The returned value is the sum of squared residuals. If you want to fit a partial transform (e.g. such that this(T1(p1)) = T2(p2), use StarMatchList::applyTransform beforehand.

Implements lsst::jointcal::AstrometryTransform.

Definition at line 1780 of file AstrometryTransform.cc.

◆ getJacobian() [1/2]

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

returns the local jacobian.

Definition at line 100 of file AstrometryTransform.cc.

◆ getJacobian() [2/2]

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

returns the local jacobian.

Definition at line 110 of file AstrometryTransform.h.

◆ getLinPart()

AstrometryTransformLinear lsst::jointcal::TanRaDecToPixel::getLinPart ( ) const

The Linear part (corresponding to CD's and CRPIX's)

Definition at line 1682 of file AstrometryTransform.cc.

◆ getNpar()

virtual std::size_t lsst::jointcal::AstrometryTransform::getNpar ( ) const
inlinevirtualinherited

◆ getParams()

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

params should be at least Npar() long

Definition at line 217 of file AstrometryTransform.cc.

◆ getTangentPoint()

Point lsst::jointcal::TanRaDecToPixel::getTangentPoint ( ) const

tangent point coordinates (degrees)

Definition at line 1680 of file AstrometryTransform.cc.

◆ inverseTransform()

std::unique_ptr< AstrometryTransform > lsst::jointcal::TanRaDecToPixel::inverseTransform ( double  precision,
const Frame region 
) const
virtual

Inverse transform: returns a TanPixelToRaDec.

Reimplemented from lsst::jointcal::AstrometryTransform.

Definition at line 1771 of file AstrometryTransform.cc.

◆ inverted()

TanPixelToRaDec lsst::jointcal::TanRaDecToPixel::inverted ( ) const

exact typed inverse:

Definition at line 1756 of file AstrometryTransform.cc.

◆ linearApproximation()

AstrometryTransformLinear lsst::jointcal::AstrometryTransform::linearApproximation ( Point const &  where,
double  step = 0.01 
) const
virtualinherited

linear (local) approximation.

Reimplemented in lsst::jointcal::AstrometryTransformIdentity, and lsst::jointcal::AstrometryTransformLinear.

Definition at line 137 of file AstrometryTransform.cc.

◆ offsetParams()

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

Definition at line 222 of file AstrometryTransform.cc.

◆ paramDerivatives()

void lsst::jointcal::AstrometryTransform::paramDerivatives ( Point const &  where,
double *  dx,
double *  dy 
) const
virtualinherited

Derivative w.r.t parameters.

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

Reimplemented in lsst::jointcal::AstrometryTransformPolynomial.

Definition at line 237 of file AstrometryTransform.cc.

◆ paramRef() [1/2]

double & lsst::jointcal::AstrometryTransform::paramRef ( Eigen::Index  i)
virtualinherited

Reimplemented in lsst::jointcal::AstrometryTransformPolynomial.

Definition at line 232 of file AstrometryTransform.cc.

◆ paramRef() [2/2]

double lsst::jointcal::AstrometryTransform::paramRef ( Eigen::Index  i) const
virtualinherited

Reimplemented in lsst::jointcal::AstrometryTransformPolynomial.

Definition at line 227 of file AstrometryTransform.cc.

◆ print()

void lsst::jointcal::TanRaDecToPixel::print ( std::ostream out) const
virtual

prints the transform coefficients to stream.

Implements lsst::jointcal::AstrometryTransform.

Definition at line 1760 of file AstrometryTransform.cc.

◆ roughInverse()

std::unique_ptr< AstrometryTransform > lsst::jointcal::TanRaDecToPixel::roughInverse ( const Frame region) const
virtual

Overload the "generic routine" (available for all AstrometryTransform types.

Reimplemented from lsst::jointcal::AstrometryTransform.

Definition at line 1766 of file AstrometryTransform.cc.

◆ setTangentPoint()

void lsst::jointcal::TanRaDecToPixel::setTangentPoint ( Point const &  tangentPoint)

Resets the projection (or tangent) point.

Definition at line 1665 of file AstrometryTransform.cc.

◆ toAstMap()

virtual std::shared_ptr< ast::Mapping > lsst::jointcal::AstrometryTransform::toAstMap ( jointcal::Frame const &  domain) const
inlinevirtualinherited

Create an equivalent AST mapping for this transformation, including an analytic inverse if possible.

Parameters
domainThe domain of the transform, to help find an inverse.
Returns
An AST Mapping that represents this transformation.

Reimplemented in lsst::jointcal::AstrometryTransformIdentity, and lsst::jointcal::AstrometryTransformPolynomial.

Definition at line 189 of file AstrometryTransform.h.

◆ transformErrors()

void lsst::jointcal::AstrometryTransform::transformErrors ( Point const &  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 163 of file AstrometryTransform.cc.

◆ transformPosAndErrors()

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

transform with analytical derivatives

Reimplemented from lsst::jointcal::AstrometryTransform.

Definition at line 1685 of file AstrometryTransform.cc.

◆ transformStar()

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

Definition at line 107 of file AstrometryTransform.h.

◆ write() [1/2]

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

Definition at line 247 of file AstrometryTransform.cc.

◆ write() [2/2]

void lsst::jointcal::AstrometryTransform::write ( std::ostream stream) const
virtualinherited

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