Class Frame
- java.lang.Object
-
- org.orekit.frames.Frame
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CR3BPRotatingFrame
,ExtendedPVCoordinatesProviderAdapter
,FactoryManagedFrame
,L1Frame
,L2Frame
,LocalOrbitalFrame
,ModifiedFrame
,TopocentricFrame
,TwoBodiesBaryFrame
,UpdatableFrame
,VersionedITRF
public class Frame extends Object implements Serializable
Tridimensional references frames class.Frame Presentation
This class is the base class for all frames in OREKIT. The frames are linked together in a tree with some specific frame chosen as the root of the tree. Each frame is defined by
transforms
combining any number of translations and rotations from a reference frame which is its parent frame in the tree structure.When we say a
transform
t is from frameA to frameB, we mean that if the coordinates of some absolute vector (say the direction of a distant star for example) has coordinates uA in frameA and uB in frameB, then uB=t.transformVector(uA)
.The transforms may be constant or varying, depending on the implementation of the
transform provider
used to define the frame. For simple fixed transforms, usingFixedTransformProvider
is sufficient. For varying transforms (time-dependent or telemetry-based for example), it may be useful to define specific implementations oftransform provider
.- Author:
- Guylaine Prat, Luc Maisonobe, Pascal Parraud
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Frame(Frame parent, TransformProvider transformProvider, String name)
Build a non-inertial frame from its transform with respect to its parent.Frame(Frame parent, TransformProvider transformProvider, String name, boolean pseudoInertial)
Build a frame from its transform with respect to its parent.Frame(Frame parent, Transform transform, String name)
Build a non-inertial frame from its transform with respect to its parent.Frame(Frame parent, Transform transform, String name, boolean pseudoInertial)
Build a frame from its transform with respect to its parent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Frame
getAncestor(int n)
Get the nth ancestor of the frame.int
getDepth()
Get the depth of the frame.Frame
getFrozenFrame(Frame reference, AbsoluteDate freezingDate, String frozenName)
Get a new version of the instance, frozen with respect to a reference frame.KinematicTransform
getKinematicTransformTo(Frame destination, AbsoluteDate date)
Get the kinematic portion of the transform from the instance to another frame.<T extends CalculusFieldElement<T>>
FieldKinematicTransform<T>getKinematicTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the kinematic portion of the transform from the instance to another frame.String
getName()
Get the name.Frame
getParent()
Get the parent frame.static Frame
getRoot()
Get the unique root frame.StaticTransform
getStaticTransformTo(Frame destination, AbsoluteDate date)
Get the static portion of the transform from the instance to another frame.<T extends CalculusFieldElement<T>>
FieldStaticTransform<T>getStaticTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the static portion of the transform from the instance to another frame.TransformProvider
getTransformProvider()
Get the provider for transform from parent frame to instance.Transform
getTransformTo(Frame destination, AbsoluteDate date)
Get the transform from the instance to another frame.<T extends CalculusFieldElement<T>>
FieldTransform<T>getTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the transform from the instance to another frame.boolean
isChildOf(Frame potentialAncestor)
Determine if a Frame is a child of another one.boolean
isPseudoInertial()
Check if the frame is pseudo-inertial.String
toString()
New definition of the java.util toString() method.
-
-
-
Constructor Detail
-
Frame
public Frame(Frame parent, Transform transform, String name) throws IllegalArgumentException
Build a non-inertial frame from its transform with respect to its parent.calling this constructor is equivalent to call
{link
.Frame(parent, transform, name, false)
- Parameters:
parent
- parent frame (must be non-null)transform
- transform from parent frame to instancename
- name of the frame- Throws:
IllegalArgumentException
- if the parent frame is null
-
Frame
public Frame(Frame parent, TransformProvider transformProvider, String name) throws IllegalArgumentException
Build a non-inertial frame from its transform with respect to its parent.calling this constructor is equivalent to call
{link
.Frame(parent, transform, name, false)
- Parameters:
parent
- parent frame (must be non-null)transformProvider
- provider for transform from parent frame to instancename
- name of the frame- Throws:
IllegalArgumentException
- if the parent frame is null
-
Frame
public Frame(Frame parent, Transform transform, String name, boolean pseudoInertial) throws IllegalArgumentException
Build a frame from its transform with respect to its parent.The convention for the transform is that it is from parent frame to instance. This means that the two following frames are similar:
Frame frame1 = new Frame(FramesFactory.getGCRF(), new Transform(t1, t2)); Frame frame2 = new Frame(new Frame(FramesFactory.getGCRF(), t1), t2);
- Parameters:
parent
- parent frame (must be non-null)transform
- transform from parent frame to instancename
- name of the framepseudoInertial
- true if frame is considered pseudo-inertial (i.e. suitable for propagating orbit)- Throws:
IllegalArgumentException
- if the parent frame is null
-
Frame
public Frame(Frame parent, TransformProvider transformProvider, String name, boolean pseudoInertial) throws IllegalArgumentException
Build a frame from its transform with respect to its parent.The convention for the transform is that it is from parent frame to instance. This means that the two following frames are similar:
Frame frame1 = new Frame(FramesFactory.getGCRF(), new Transform(t1, t2)); Frame frame2 = new Frame(new Frame(FramesFactory.getGCRF(), t1), t2);
- Parameters:
parent
- parent frame (must be non-null)transformProvider
- provider for transform from parent frame to instancename
- name of the framepseudoInertial
- true if frame is considered pseudo-inertial (i.e. suitable for propagating orbit)- Throws:
IllegalArgumentException
- if the parent frame is null
-
-
Method Detail
-
getName
public String getName()
Get the name.- Returns:
- the name
-
isPseudoInertial
public boolean isPseudoInertial()
Check if the frame is pseudo-inertial.Pseudo-inertial frames are frames that do have a linear motion and either do not rotate or rotate at a very low rate resulting in neglectible inertial forces. This means they are suitable for orbit definition and propagation using Newtonian mechanics. Frames that are not pseudo-inertial are not suitable for orbit definition and propagation.
- Returns:
- true if frame is pseudo-inertial
-
toString
public String toString()
New definition of the java.util toString() method.
-
getParent
public Frame getParent()
Get the parent frame.- Returns:
- parent frame
-
getDepth
public int getDepth()
Get the depth of the frame.The depth of a frame is the number of parents frame between it and the frames tree root. It is 0 for the root frame, and the depth of a frame is the depth of its parent frame plus one.
- Returns:
- depth of the frame
-
getAncestor
public Frame getAncestor(int n) throws IllegalArgumentException
Get the nth ancestor of the frame.- Parameters:
n
- index of the ancestor (0 is the instance, 1 is its parent, 2 is the parent of its parent...)- Returns:
- nth ancestor of the frame (must be between 0 and the depth of the frame)
- Throws:
IllegalArgumentException
- if n is larger than the depth of the instance
-
getTransformTo
public Transform getTransformTo(Frame destination, AbsoluteDate date)
Get the transform from the instance to another frame.- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (can be null if it is sure than no date dependent frame is used)- Returns:
- transform from the instance to the destination frame
-
getTransformTo
public <T extends CalculusFieldElement<T>> FieldTransform<T> getTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the transform from the instance to another frame.- Type Parameters:
T
- the type of the field elements- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (must be non-null, which is a more stringent condition * than ingetTransformTo(Frame, FieldAbsoluteDate)
)- Returns:
- transform from the instance to the destination frame
-
getKinematicTransformTo
public KinematicTransform getKinematicTransformTo(Frame destination, AbsoluteDate date)
Get the kinematic portion of the transform from the instance to another frame. The returned transform is kinematic in the sense that it includes translations and rotations, with rates, but cannot transform an acceleration vector.This method is often more performant than
getTransformTo(Frame, AbsoluteDate)
when accelerations are not needed.- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (can be null if it is sure than no date dependent frame is used)- Returns:
- kinematic transform from the instance to the destination frame
- Since:
- 12.1
-
getStaticTransformTo
public StaticTransform getStaticTransformTo(Frame destination, AbsoluteDate date)
Get the static portion of the transform from the instance to another frame. The returned transform is static in the sense that it includes translations and rotations, but not rates.This method is often more performant than
getTransformTo(Frame, AbsoluteDate)
when rates are not needed.- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (can be null if it is sure than no date dependent frame is used)- Returns:
- static transform from the instance to the destination frame
- Since:
- 11.2
-
getStaticTransformTo
public <T extends CalculusFieldElement<T>> FieldStaticTransform<T> getStaticTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the static portion of the transform from the instance to another frame. The returned transform is static in the sense that it includes translations and rotations, but not rates.This method is often more performant than
getTransformTo(Frame, FieldAbsoluteDate)
when rates are not needed.A first check is made on the FieldAbsoluteDate because "fielded" transforms have low-performance.
The date field is checked withFieldElement.isZero()
.
If true, the un-fielded version of the transform computation is used.- Type Parameters:
T
- type of the elements- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (must be non-null, which is a more stringent condition than ingetStaticTransformTo(Frame, AbsoluteDate)
)- Returns:
- static transform from the instance to the destination frame
- Since:
- 12.0
-
getKinematicTransformTo
public <T extends CalculusFieldElement<T>> FieldKinematicTransform<T> getKinematicTransformTo(Frame destination, FieldAbsoluteDate<T> date)
Get the kinematic portion of the transform from the instance to another frame. The returned transform is kinematic in the sense that it includes translations and rotations, with rates, but cannot transform an acceleration vector.This method is often more performant than
getTransformTo(Frame, AbsoluteDate)
when accelerations are not needed.- Type Parameters:
T
- Type of transform returned.- Parameters:
destination
- destination frame to which we want to transform vectorsdate
- the date (must be non-null, which is a more stringent condition * than ingetKinematicTransformTo(Frame, AbsoluteDate)
)- Returns:
- kinematic transform from the instance to the destination frame
- Since:
- 12.1
-
getTransformProvider
public TransformProvider getTransformProvider()
Get the provider for transform from parent frame to instance.- Returns:
- provider for transform from parent frame to instance
-
isChildOf
public boolean isChildOf(Frame potentialAncestor)
Determine if a Frame is a child of another one.- Parameters:
potentialAncestor
- supposed ancestor frame- Returns:
- true if the potentialAncestor belongs to the path from instance to the root frame, excluding itself
-
getRoot
public static Frame getRoot()
Get the unique root frame.- Returns:
- the unique instance of the root frame
-
getFrozenFrame
public Frame getFrozenFrame(Frame reference, AbsoluteDate freezingDate, String frozenName)
Get a new version of the instance, frozen with respect to a reference frame.Freezing a frame consist in computing its position and orientation with respect to another frame at some freezing date and fixing them so they do not depend on time anymore. This means the frozen frame is fixed with respect to the reference frame.
One typical use of this method is to compute an inertial launch reference frame by freezing a
topocentric frame
at launch date with respect to an inertial frame. Another use is to freeze an equinox-related celestial frame at a reference epoch date.Only the frame returned by this method is frozen, the instance by itself is not affected by calling this method and still moves freely.
- Parameters:
reference
- frame with respect to which the instance will be frozenfreezingDate
- freezing datefrozenName
- name of the frozen frame- Returns:
- a frozen version of the instance
-
-