public final class InternationalTerrestrialReferenceFrameTransformer extends DefinitionalObject
See the ITRF website for details on how the transformations are performed.
The EarthOrientationParameters
of the EarthCentralBody
determine which ITRF is the same as the FixedFrame
(get
/ set
) of the
Earth. By default, this will be the ITRF2020 unless the EarthOrientationParameters
specify otherwise.
Constructor and Description |
---|
InternationalTerrestrialReferenceFrameTransformer()
Initializes a new instance.
|
InternationalTerrestrialReferenceFrameTransformer(String from,
String to,
JulianDate epoch,
Motion1<Cartesian> translation,
Motion1<Double> scaling,
Motion1<Cartesian> rotation)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkForSameDefinition(DefinitionalObject other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
Axes |
convertAxes(Axes fromAxes,
Axes axes)
Converts an
Axes such that the ITRF transformation is applied when it is evaluated. |
static Axes |
convertAxes(EarthCentralBody earth,
Axes axes,
String toFrame)
Converts an
Axes such that an ITRF transformation is applied when it is evaluated. |
static Axes |
convertAxes(EarthCentralBody earth,
Axes axes,
String toFrame,
ArrayList<InternationalTerrestrialReferenceFrameTransformer> itrfList)
Converts an
Axes such that an ITRF transformation is applied when it is evaluated. |
static Point |
convertPoint(EarthCentralBody earth,
Point point,
String toFrame)
Converts a
Point such that an ITRF transformation is applied when it is evaluated. |
static Point |
convertPoint(EarthCentralBody earth,
Point point,
String toFrame,
ArrayList<InternationalTerrestrialReferenceFrameTransformer> itrfList)
Converts a
Point such that an ITRF transformation is applied when it is evaluated. |
Point |
convertPoint(ReferenceFrame fromFrame,
Point point)
Converts a
Point such that the ITRF transformation is applied when it is evaluated. |
static PointInterpolator |
createPointInterpolatorInFixedFrame(EarthCentralBody earth,
InternationalTerrestrialReferenceFrameTransformer itrf,
String itrfFrameOfData,
InterpolationAlgorithm algorithm,
int interpolationDegree,
DateMotionCollection1<Cartesian> data)
|
static PointInterpolator |
createPointInterpolatorInFixedFrame(EarthCentralBody earth,
Iterable<InternationalTerrestrialReferenceFrameTransformer> itrfList,
String itrfFrameOfData,
InterpolationAlgorithm algorithm,
int interpolationDegree,
DateMotionCollection1<Cartesian> data)
|
JulianDate |
getEpoch()
Gets the defined epoch for the constant terms in the transformation.
|
InternationalTerrestrialReferenceFrameEvaluator |
getEvaluator()
Gets an evaluator that can be used to find a
HelmertTransformation representing
the motion of the To (get / set ) ITRF relative to the From (get / set ) ITRF
at a given JulianDate . |
InternationalTerrestrialReferenceFrameEvaluator |
getEvaluator(EvaluatorGroup group)
Gets an evaluator that can be used to find a
HelmertTransformation representing
the motion of the To (get / set ) ITRF relative to the From (get / set ) ITRF
at a given JulianDate . |
static InternationalTerrestrialReferenceFrameTransformer |
getFirstFromList(Iterable<InternationalTerrestrialReferenceFrameTransformer> itrfList,
String from,
String to)
Gets the first ITRF transformation in the list with the desired characteristics.
|
String |
getFrom()
|
static ArrayList<InternationalTerrestrialReferenceFrameTransformer> |
getItrfDefinitions()
Gets a list of ITRF transformers that can convert from ITRF2020 and ITRF2014 to earlier ITRF frames.
|
Motion1<Cartesian> |
getRotation()
|
Motion1<Double> |
getScaling()
|
String |
getTo()
Gets the name of the ITRF that coordinates are being transformed into.
|
Motion1<Cartesian> |
getTranslation()
|
static ArrayList<InternationalTerrestrialReferenceFrameTransformer> |
readFromItrfDefinitionsFile(BufferedReader reader)
Reads an ITRF definitions file and creates a list of ITRF transformations.
|
static ArrayList<InternationalTerrestrialReferenceFrameTransformer> |
readFromItrfDefinitionsFile(String filepath)
Reads an ITRF definitions file and creates a list of ITRF transformations.
|
static ArrayList<InternationalTerrestrialReferenceFrameTransformer> |
readFromItrfTransformationFile(BufferedReader reader)
Reads an ITRF transformation parameters file and creates a list of ITRF transformations.
|
static ArrayList<InternationalTerrestrialReferenceFrameTransformer> |
readFromItrfTransformationFile(String filepath)
Reads an ITRF transformation parameters file and creates a list of ITRF transformations.
|
void |
setEpoch(JulianDate value)
Sets the defined epoch for the constant terms in the transformation.
|
void |
setFrom(String value)
|
void |
setRotation(Motion1<Cartesian> value)
|
void |
setScaling(Motion1<Double> value)
|
void |
setTo(String value)
Sets the name of the ITRF that coordinates are being transformed into.
|
void |
setTranslation(Motion1<Cartesian> value)
|
DateMotionCollection1<Cartesian> |
transformCollection(DateMotionCollection1<Cartesian> collection)
|
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, enumerateDependencies, freeze, freezeAggregatedObjects, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozen
public InternationalTerrestrialReferenceFrameTransformer()
public InternationalTerrestrialReferenceFrameTransformer(String from, String to, @Nonnull JulianDate epoch, @Nonnull Motion1<Cartesian> translation, @Nonnull Motion1<Double> scaling, @Nonnull Motion1<Cartesian> rotation)
from
- The name of the ITRF whose coordinates are being transformed into the
to
ITRF.to
- The name of the ITRF that the coordinates are being transformed into.epoch
- The defined epoch for the constant terms in the transformation.translation
- The constant position offset between the two ITRFs, and the rate at which
it changes after the epoch
.scaling
- A small number that is added to one to form the diagonal components
of the skew-symmetric rotation matrix that is used to transform between the ITRFs, and the rate at which
it changes after the epoch
.rotation
- The off-diagonal components of the skew-symmetric rotation matrix that is used to
transform between the ITRFs, and the rate at which it changes after the epoch
.public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class DefinitionalObject
context
- The context to use to perform the copy.protected boolean checkForSameDefinition(DefinitionalObject other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.checkForSameDefinition
in class DefinitionalObject
other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected int computeCurrentDefinitionHashCode()
InternationalTerrestrialReferenceFrameTransformer.checkForSameDefinition(agi.foundation.infrastructure.DefinitionalObject)
method.computeCurrentDefinitionHashCode
in class DefinitionalObject
public final String getFrom()
public final void setFrom(String value)
public final String getTo()
public final void setTo(String value)
@Nullable public final JulianDate getEpoch()
public final void setEpoch(@Nullable JulianDate value)
@Nonnull public static ArrayList<InternationalTerrestrialReferenceFrameTransformer> getItrfDefinitions()
@Nonnull public static InternationalTerrestrialReferenceFrameTransformer getFirstFromList(@Nonnull Iterable<InternationalTerrestrialReferenceFrameTransformer> itrfList, String from, String to)
Note that lists obtained from the file readers in this class change the names of the ITRFs before 2000 by converting to four-digit year numbers (e.g. ITRF97 becomes ITRF1997).
itrfList
- A list of ITRF transformations.from
- The name of the desired ITRF that is used as the fixed frame
whose coordinates are being transformed into the to
.to
- The name of the ITRF that the coordinates are being transformed into.ArgumentNullException
- Thrown when itrfList
is null
.IllegalStateException
- Thrown when itrfList
is empty
or does not contain an ITRF transformation with the desired characteristics.@Nonnull public final DateMotionCollection1<Cartesian> transformCollection(@Nonnull DateMotionCollection1<Cartesian> collection)
collection
- The collection to be transformed.ArgumentNullException
- Thrown when collection
is null
.@Nonnull public static PointInterpolator createPointInterpolatorInFixedFrame(@Nonnull EarthCentralBody earth, @Nonnull Iterable<InternationalTerrestrialReferenceFrameTransformer> itrfList, @Nonnull String itrfFrameOfData, @Nonnull InterpolationAlgorithm algorithm, int interpolationDegree, @Nonnull DateMotionCollection1<Cartesian> data)
FixedFrame
(get
/ set
) that is built using data in an ITRF.
If the native ITRF of the Earth orientation parameters is the same as the itrfFrameOfData
,
the fixed frame will be used with no ITRF transformations being performed on the data. If the ITRFs are different,
then an ITRF transformation will be performed on the data before the point interpolator is built.
earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).itrfList
- A list of ITRF transformations that contains the transformation from itrfFrameOfData
to the NativeItrfFrame
(get
).itrfFrameOfData
- The ITRF that is the native frame of the data
.algorithm
- The interpolation algorithm to be used to build the point interpolator.interpolationDegree
- The degree of the interpolation algorithm.data
- The data in the itrfFrameOfData
that is to be interpolated.ArgumentNullException
- Thrown when earth
, itrfList
, itrfFrameOfData
,
algorithm
, or data
is null
.ArgumentOutOfRangeException
- Thrown when interpolationDegree
is less than zero.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when itrfList
does not contain the
necessary transformation to go from itrfFrameOfData
to the
NativeItrfFrame
(get
) of the OrientationParameters
(get
/ set
)
of the earth
(if the two frames are not the same).@Nonnull public static PointInterpolator createPointInterpolatorInFixedFrame(@Nonnull EarthCentralBody earth, @Nonnull InternationalTerrestrialReferenceFrameTransformer itrf, @Nonnull String itrfFrameOfData, @Nonnull InterpolationAlgorithm algorithm, int interpolationDegree, @Nonnull DateMotionCollection1<Cartesian> data)
FixedFrame
(get
/ set
) that is built using data in an ITRF.
If the native ITRF of the Earth orientation parameters is the same as the itrfFrameOfData
,
the fixed frame will be used with no ITRF transformations being performed on the data. If the ITRFs are different,
then an ITRF transformation will be performed on the data before the point interpolator is built.
earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).itrf
- The ITRF transformation that contains the transformation from itrfFrameOfData
to the NativeItrfFrame
(get
).itrfFrameOfData
- The ITRF that is the native frame of the data
.algorithm
- The interpolation algorithm to be used to build the point interpolator.interpolationDegree
- The degree of the interpolation algorithm.data
- The data in the itrfFrameOfData
that is to be interpolated.ArgumentNullException
- Thrown when earth
, itrf
, itrfFrameOfData
,
algorithm
, or data
is null
.ArgumentOutOfRangeException
- Thrown when interpolationDegree
is less than zero.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when itrf
does not contain the
necessary transformation to go from itrfFrameOfData
to the
NativeItrfFrame
(get
) of the OrientationParameters
(get
/ set
)
of the earth
(if the two frames are not the same).@Nonnull public static ArrayList<InternationalTerrestrialReferenceFrameTransformer> readFromItrfDefinitionsFile(@Nonnull String filepath)
The units are automatically converted into meters, seconds, and radians from mm, years, and milli-arc seconds.
Parts per billion (ppb) are divided by one billion to make the Scaling
(get
/ set
) constant term unitless.
A file of this format should be able to be found in the DynamicEarthData folder of a STK install that is 12.7 or later (2023r2 or later). Specifically, the correct file in that folder should be named "ITRFDefns.txt".
filepath
- String file path for ITRF definitions file.ArgumentNullException
- Thrown when filepath
is null
.@Nonnull public static ArrayList<InternationalTerrestrialReferenceFrameTransformer> readFromItrfDefinitionsFile(@Nonnull BufferedReader reader)
The units are automatically converted into meters, seconds, and radians from mm, years, and milli-arc seconds.
Parts per billion (ppb) are divided by one billion to make the Scaling
(get
/ set
) constant term unitless.
A file of this format should be able to be found in the DynamicEarthData folder of a STK install that is 12.7 or later (2023r2 or later). Specifically, the correct file in that folder should be named "ITRFDefns.txt".
reader
- A BufferedReader
for the ITRF definitions .txt file.ArgumentNullException
- Thrown when reader
is null
.@Nonnull public static ArrayList<InternationalTerrestrialReferenceFrameTransformer> readFromItrfTransformationFile(@Nonnull String filepath)
The units are automatically converted into meters, seconds, and radians from mm, years, and milli-arc seconds.
Parts per billion (ppb) are divided by one billion to make the Scaling
(get
/ set
) constant term unitless.
The names of the ITRFs before 2000 in the files are modified to include four-digit years (e.g. ITRF97 becomes
ITRF1997)
A file of this format that handles conversions to and from ITRF2020 can be found here. A similar file that handles conversions to and from ITRF2014 can be found here.
filepath
- String file path for ITRF transformation parameters file.ArgumentNullException
- Thrown when filepath
is null
.@Nonnull public static ArrayList<InternationalTerrestrialReferenceFrameTransformer> readFromItrfTransformationFile(@Nonnull BufferedReader reader)
The units are automatically converted into meters, seconds, and radians from mm, years, and milli-arc seconds.
Parts per billion (ppb) are divided by one billion to make the Scaling
(get
/ set
) constant term unitless.
The names of the ITRFs before 2000 in the files are modified to include four-digit years (e.g. ITRF97 becomes ITRF1997)
A file of this format that handles conversions to and from ITRF2020 can be found here. A similar file that handles conversions to and from ITRF2014 can be found here.
reader
- A BufferedReader
for the ITRF transformation parameters .txt file.ArgumentNullException
- Thrown when reader
is null
.@Nonnull public static Point convertPoint(@Nonnull EarthCentralBody earth, @Nonnull Point point, @Nonnull String toFrame)
Point
such that an ITRF transformation is applied when it is evaluated.
ItrfDefinitions
(get
) is used to provide ITRF transformations.earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).point
- The point to be converted.toFrame
- The name of the ITRF that the point is being converted into.ArgumentNullException
- Thrown when earth
, point
, or toFrame
is null
.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when ItrfDefinitions
(get
) does not contain the
necessary transformation to go from the NativeItrfFrame
(get
)
of the OrientationParameters
(get
/ set
) of the earth
to
the toFrame
(if the two frames are not the same).@Nonnull public static Point convertPoint(@Nonnull EarthCentralBody earth, @Nonnull Point point, @Nonnull String toFrame, @Nonnull ArrayList<InternationalTerrestrialReferenceFrameTransformer> itrfList)
Point
such that an ITRF transformation is applied when it is evaluated.earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).point
- The point to be converted.toFrame
- The name of the ITRF that the point is being converted into.itrfList
- A list of ITRF transformations that contains a transformation
from the NativeItrfFrame
(get
) of the
OrientationParameters
(get
/ set
) of the EarthCentralBody
to the toFrame
.ArgumentNullException
- Thrown when earth
, point
, toFrame
, or itrfList
is null
.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when itrfList
does not contain the
necessary transformation to go from the NativeItrfFrame
(get
)
of the OrientationParameters
(get
/ set
) of the earth
to
the toFrame
(if the two frames are not the same).@Nonnull public static Axes convertAxes(@Nonnull EarthCentralBody earth, @Nonnull Axes axes, @Nonnull String toFrame)
Axes
such that an ITRF transformation is applied when it is evaluated.
ItrfDefinitions
(get
) is used to provide ITRF transformations.earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).axes
- The axes to be converted.toFrame
- The name of the ITRF that the axes is being converted into.ArgumentNullException
- Thrown when earth
, axes
, or toFrame
is null
.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when ItrfDefinitions
(get
) does not contain the
necessary transformation to go from the NativeItrfFrame
(get
)
of the OrientationParameters
(get
/ set
) of the earth
to
the toFrame
(if the two frames are not the same).@Nonnull public static Axes convertAxes(@Nonnull EarthCentralBody earth, @Nonnull Axes axes, @Nonnull String toFrame, @Nonnull ArrayList<InternationalTerrestrialReferenceFrameTransformer> itrfList)
Axes
such that an ITRF transformation is applied when it is evaluated.earth
- An EarthCentralBody
configured with OrientationParameters
(get
/ set
)
that have a NativeItrfFrame
(get
).axes
- The axes to be converted.toFrame
- The name of the ITRF that the axes is being converted into.itrfList
- A list of ITRF transformations that contains a transformation
from the NativeItrfFrame
(get
) of the
OrientationParameters
(get
/ set
) of the EarthCentralBody
to the toFrame
.ArgumentNullException
- Thrown when earth
, axes
, toFrame
, or itrfList
is null
.IllegalStateException
- Thrown when the OrientationParameters
(get
/ set
) of earth
are null
or do not contain a NativeItrfFrame
(get
).InvalidDataException
- Thrown when itrfList
does not contain the
necessary transformation to go from the NativeItrfFrame
(get
)
of the OrientationParameters
(get
/ set
) of the earth
to
the toFrame
(if the two frames are not the same).@Nonnull public final Point convertPoint(@Nonnull ReferenceFrame fromFrame, @Nonnull Point point)
Point
such that the ITRF transformation is applied when it is evaluated.fromFrame
- A reference frame that is the same frame as From
(get
/ set
).point
- The point to be converted.ArgumentNullException
- Thrown when fromFrame
or point
is null
.PropertyInvalidException
- Thrown when Epoch
(get
/ set
) is null
.@Nonnull public final Axes convertAxes(@Nonnull Axes fromAxes, @Nonnull Axes axes)
Axes
such that the ITRF transformation is applied when it is evaluated.fromAxes
- An axes that is the same axes as the Axes
(get
/ set
) of From
(get
/ set
).axes
- The axes to be converted.ArgumentNullException
- Thrown when fromAxes
or axes
is null
.PropertyInvalidException
- Thrown when Epoch
(get
/ set
) is null
.@Nonnull public final InternationalTerrestrialReferenceFrameEvaluator getEvaluator()
HelmertTransformation
representing
the motion of the To
(get
/ set
) ITRF relative to the From
(get
/ set
) ITRF
at a given JulianDate
.PropertyInvalidException
- Thrown when the property Epoch
(get
/ set
) is null
.@Nonnull public final InternationalTerrestrialReferenceFrameEvaluator getEvaluator(@Nonnull EvaluatorGroup group)
HelmertTransformation
representing
the motion of the To
(get
/ set
) ITRF relative to the From
(get
/ set
) ITRF
at a given JulianDate
.group
- The group with which to associate the new evaluator. By grouping evaluators
that are often evaluated at the same Julian dates, common computations can be performed only once
for the entire group instead of multiple times for each evaluator.ArgumentNullException
- Thrown when group
is null
.PropertyInvalidException
- Thrown when Epoch
(get
/ set
) is null
.