Public Member Functions | Public Attributes | List of all members
gnsstk::TransformLibrary Class Reference

Detailed Description

This class provides storage and access to datum transformations. Recommended use is to create one instance of this class and either use the transformation data that is loaded by default and/or add additional transformation data. Then call the appropriate transform method for each coordinate transformation.

Call the clear() method on transformers to empty the default transformation data if desired.

Typical usage would be something like:

...
CommonTime ct = ...;
ObsID oid = ...;
Xvt xvt, xvtITRF;
eph.getXvt(ct, xvt, oid);
xvtITRF.frame = RefFrame(RefFrameRlz::ITRF2020);
if (xflib.transform(xvt, xvtITRF, ct))
{
cout << "success!" << endl;
}

Definition at line 74 of file TransformLibrary.hpp.

#include <TransformLibrary.hpp>

Public Member Functions

void addTransform (const TransformerPtr &ptr)
 
bool getTransform (const RefFrame &fromFrame, const RefFrame &toFrame, TransformerPtr &ptr, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const
 
bool transform (const Position &fromPos, Position &toPos, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const noexcept
 
bool transform (const Triple &fromPos, const RefFrame &srcFrame, Triple &toPos, const RefFrame &tgtFrame, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const noexcept
 
bool transform (const Vector< double > &fromPos, const RefFrame &srcFrame, Vector< double > &toPos, const RefFrame &tgtFrame, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const noexcept
 
bool transform (const Xvt &fromPos, Xvt &toPos, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const noexcept
 
bool transform (double fx, double fy, double fz, const RefFrame &srcFrame, double &tx, double &ty, double &tz, const RefFrame &tgtFrame, const CommonTime &when=gnsstk::CommonTime::END_OF_TIME) const noexcept
 
 TransformLibrary ()
 Fill the library with a default set of transformation parameters. More...
 

Public Attributes

TransformerMap transformers
 More than meets the eye. More...
 

Constructor & Destructor Documentation

◆ TransformLibrary()

gnsstk::TransformLibrary::TransformLibrary ( )

Fill the library with a default set of transformation parameters.

Note
This transformation, as the others, was copied from an earlier implementation in HelmertTransform.cpp. I have been unable to track down the source, and the target reference frame and rotation parameters are somewhat dubious. The target reference frame does not match the description, and the Z rotation parameter is the opposite sign of two other references I found for similar transformations. addTransform(std::make_shared<HelmertTransformer>( RefFrame(RefFrameRlz::PZ90Y2007), RefFrame(RefFrameRlz::WGS84G1150), 0, 0, 0, -0.36, 0.08, 0.18, 0, "PZ90.02 to ITRF2000, from Sergey Revnivykh, GLONASS PNT\n" " Information Analysis Center, 47th CGSIC Meeting" " and ION\n" " GNSS 2007, Fort Worth, Texas, implemented by" " GLONASS\n" " 20 Sept 2007 17:00 UTC (ICD-2008 v5.1 table 3.2).", PZ90Epoch));
Todo:
correct?

Definition at line 47 of file TransformLibrary.cpp.

Member Function Documentation

◆ addTransform()

void gnsstk::TransformLibrary::addTransform ( const TransformerPtr ptr)

Add a new Transformer to the library.

Parameters
[in]ptrThe Transformer to be added.
Postcondition
transformers contains ptr with keys in forward and reverse.

Definition at line 133 of file TransformLibrary.cpp.

◆ getTransform()

bool gnsstk::TransformLibrary::getTransform ( const RefFrame fromFrame,
const RefFrame toFrame,
TransformerPtr ptr,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const

Get the Transformer in transformers that matches the requested parameters.

Parameters
[in]fromFrameThe RefFrame being converted from.
[in]toFrameThe RefFrame being converted to.
[out]ptrThe Transformer that matches, if true is returned.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true if a match was found.

Definition at line 145 of file TransformLibrary.cpp.

◆ transform() [1/5]

bool gnsstk::TransformLibrary::transform ( const Position fromPos,
Position toPos,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const
noexcept

Convert a position from the reference frame in fromPos to that in toPos.

Precondition
RefFrame must be set in both fromPos and toPos.
Coordinates must be set in fromPos.
Postcondition
Coordinates in toPos reference frame realization are set in toPos.
Parameters
[in]fromPosThe Position to be converted.
[in,out]toPosThe Position to store the converted position.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true on success, false on failure (typically if the Position RefFrame objects don't match the ones in this Transformer).

Definition at line 169 of file TransformLibrary.cpp.

◆ transform() [2/5]

bool gnsstk::TransformLibrary::transform ( const Triple fromPos,
const RefFrame srcFrame,
Triple toPos,
const RefFrame tgtFrame,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const
noexcept

Convert a position in fromPos from the reference frame in srcFrame to that in tgtFrame.

Precondition
Coordinates must be set in fromPos.
Postcondition
Coordinates in toFrame reference frame realization are set in toPos. Velocity and clock offset are unaffected.
Parameters
[in]fromPosThe Vector whose position is to be converted.
[in]srcFrameThe RefFrame of the coordinates in fromPos.
[out]toPosThe Vector to store the converted position.
[in]tgtFrameThe RefFrame to convert to.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true on success, false on failure (typically if srcFrame doesn't match fromFrame).

Definition at line 213 of file TransformLibrary.cpp.

◆ transform() [3/5]

bool gnsstk::TransformLibrary::transform ( const Vector< double > &  fromPos,
const RefFrame srcFrame,
Vector< double > &  toPos,
const RefFrame tgtFrame,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const
noexcept

Convert a position in fromPos from the reference frame in srcFrame to that in tgtFrame.

Precondition
Coordinates must be set in fromPos.
Postcondition
Coordinates in toFrame reference frame realization are set in toPos. Velocity and clock offset are unaffected.
Parameters
[in]fromPosThe Vector whose position is to be converted.
[in]srcFrameThe RefFrame of the coordinates in fromPos.
[out]toPosThe Vector to store the converted position.
[in]tgtFrameThe RefFrame to convert to.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true on success, false on failure (typically if srcFrame doesn't match fromFrame).

Definition at line 196 of file TransformLibrary.cpp.

◆ transform() [4/5]

bool gnsstk::TransformLibrary::transform ( const Xvt fromPos,
Xvt toPos,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const
noexcept

Convert a position from the reference frame in fromPos to that in toPos.

Precondition
RefFrame must be set in both fromPos and toPos.
Coordinates must be set in fromPos.
Postcondition
Coordinates in toPos reference frame realization are set in toPos. Velocity and clock offset are unaffected.
Parameters
[in]fromPosThe Xvt whose position is to be converted.
[in,out]toPosThe Xvt to store the converted position.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true on success, false on failure (typically if the Xvt RefFrame objects don't match the ones in this Transformer).

Definition at line 183 of file TransformLibrary.cpp.

◆ transform() [5/5]

bool gnsstk::TransformLibrary::transform ( double  fx,
double  fy,
double  fz,
const RefFrame srcFrame,
double &  tx,
double &  ty,
double &  tz,
const RefFrame tgtFrame,
const CommonTime when = gnsstk::CommonTime::END_OF_TIME 
) const
noexcept

Convert 3 doubles from the reference frame in srcFrame to that in tgtFrame.

Precondition
Coordinates must be set in fromPos.
Postcondition
Coordinates in toFrame reference frame realization are set in toPos. Velocity and clock offset are unaffected.
Parameters
[in]fxECEF x coordinate in meters in srcFrame.
[in]fyECEF y coordinate in meters in srcFrame.
[in]fzECEF z coordinate in meters in srcFrame.
[in]srcFrameThe RefFrame of the coordinates in fromPos.
[out]txECEF x coordinate in meters in srcFrame.
[out]tyECEF y coordinate in meters in srcFrame.
[out]tzECEF z coordinate in meters in srcFrame.
[in]tgtFrameThe RefFrame to convert to.
[in]whenThe time of interest for the transformation. This does not affect the RefFrame, it is only used when multiple transformation parameter sets are available over a span of time. Default = most recent.
Returns
true on success, false on failure (typically if srcFrame doesn't match fromFrame).

Definition at line 230 of file TransformLibrary.cpp.

Member Data Documentation

◆ transformers

TransformerMap gnsstk::TransformLibrary::transformers

More than meets the eye.

Definition at line 208 of file TransformLibrary.hpp.


The documentation for this class was generated from the following files:
gnsstk::RefFrameRlz::ITRF2020
@ ITRF2020
ITRF, 2020 version.
example5.oid
oid
Definition: example5.py:29
gnsstk::TransformLibrary::TransformLibrary
TransformLibrary()
Fill the library with a default set of transformation parameters.
Definition: TransformLibrary.cpp:47


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:46