public class Frame extends Object implements PVCoordinatesProvider
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, using FixedTransformProvider
is sufficient.
For varying transforms (time-dependent or telemetry-based for example), it may be useful to define specific
implementations of transform provider
.
Modifier | Constructor and Description |
---|---|
|
Frame(Frame parentIn,
TransformProvider transformProviderIn,
String nameIn)
Build a non-inertial frame from its transform with respect to its parent.
|
|
Frame(Frame parentIn,
TransformProvider transformProviderIn,
String nameIn,
boolean pseudoInertialIn)
Build a frame from its transform with respect to its parent.
|
|
Frame(Frame parentIn,
Transform transformIn,
String nameIn)
Build a non-inertial frame from its transform with respect to its parent.
|
|
Frame(Frame parentIn,
Transform transformIn,
String nameIn,
boolean pseudoInertialIn)
Build a frame from its transform with respect to its parent.
|
protected |
Frame(String nameIn,
boolean pseudoInertialIn)
Private constructor used only for the root frame.
|
Modifier and Type | Method and Description |
---|---|
protected Frame |
getAncestor(int n)
Get the nth ancestor of the frame.
|
protected int |
getDepth()
Get the depth of the frame.
|
Frame |
getFirstCommonPseudoInertialAncestor(Frame frame)
Returns the first pseudo-inertial common ancestor between this and provided frame.
|
Frame |
getFirstPseudoInertialAncestor()
Returns the first pseudo-inertial ancestor in the frame tree.
|
Frame |
getFrozenFrame(Frame reference,
AbsoluteDate freezingDate,
String frozenName)
Get a new version of the instance, frozen with respect to a reference frame.
|
String |
getName()
Get the name.
|
Frame |
getNativeFrame(AbsoluteDate date,
Frame frame)
Get the native frame, i.e.
|
Frame |
getParent()
Get the parent frame.
|
PVCoordinates |
getPVCoordinates(AbsoluteDate date,
Frame frame)
Get the
PVCoordinates of the frame origin in the selected frame. |
protected static CelestialBodyFrame |
getRoot()
Get the unique root frame.
|
RealMatrix |
getTransformJacobian(Frame to,
AbsoluteDate date)
Compute the Jacobian from current frame to target frame at provided date.
|
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.
|
Transform |
getTransformTo(Frame destination,
AbsoluteDate date,
boolean computeSpinDerivatives)
Get the transform from the instance to another frame.
|
Transform |
getTransformTo(Frame destination,
AbsoluteDate date,
FramesConfiguration config)
Get the transform from the instance to another frame.
|
Transform |
getTransformTo(Frame destination,
AbsoluteDate date,
FramesConfiguration config,
boolean computeSpinDerivatives)
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.
|
void |
setName(String name)
Set frame name.
|
void |
setReferential(Frame referentialIn)
Set the referential of the frame.
|
String |
toString()
New definition of the java.util toString() method.
|
protected Frame(String nameIn, boolean pseudoInertialIn)
nameIn
- name of the frame.pseudoInertialIn
- true if frame is considered pseudo-inertial (i.e. suitable for propagating orbit)public Frame(Frame parentIn, Transform transformIn, String nameIn)
calling this constructor is equivalent to call {link
.
Frame(parent, transform, name, false)
parentIn
- parent frame (must be non-null)transformIn
- transform from parent frame to instancenameIn
- name of the frame. Must be unique!IllegalArgumentException
- if the parent frame is nullpublic Frame(Frame parentIn, TransformProvider transformProviderIn, String nameIn)
calling this constructor is equivalent to call {link
.
Frame(parent, transform, name, false)
parentIn
- parent frame (must be non-null)transformProviderIn
- provider for transform from parent frame to instancenameIn
- name of the frame. Must be unique!IllegalArgumentException
- if the parent frame is nullpublic Frame(Frame parentIn, Transform transformIn, String nameIn, boolean pseudoInertialIn)
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);
parentIn
- parent frame (must be non-null)transformIn
- transform from parent frame to instancenameIn
- name of the frame. Must be unique!pseudoInertialIn
- true if frame is considered pseudo-inertial (i.e. suitable for propagating orbit)IllegalArgumentException
- if the parent frame is nullpublic Frame(Frame parentIn, TransformProvider transformProviderIn, String nameIn, boolean pseudoInertialIn)
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);
parentIn
- parent frame (must be non-null)transformProviderIn
- provider for transform from parent frame to instancenameIn
- name of the frame. Must be unique!pseudoInertialIn
- true if frame is considered pseudo-inertial (i.e. suitable for propagating orbit)IllegalArgumentException
- if the parent frame is nullpublic String getName()
protected int getDepth()
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.
protected Frame getAncestor(int n)
n
- index of the ancestor (0 is the instance, 1 is its parent, 2
is the parent of its parent...)IllegalArgumentException
- if n is larger than the depth of the instancepublic boolean isPseudoInertial()
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.
Warning: this notion depends on the horizon of propagation and the "level of inertiality of the frame". As a rule of thumb, precession/nutation effects of Earth frames such as CIRF/MOD are considered small enough on a horizon of a day to consider them pseudo-inertial.
public String toString()
public Frame getParent()
public Transform getTransformTo(Frame destination, AbsoluteDate date) throws PatriusException
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)PatriusException
- if some frame specific error occurspublic Transform getTransformTo(Frame destination, AbsoluteDate date, boolean computeSpinDerivatives) throws PatriusException
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)computeSpinDerivatives
- spin derivatives are computed : true, or not : falsePatriusException
- if some frame specific error occurspublic Transform getTransformTo(Frame destination, AbsoluteDate date, FramesConfiguration config) throws PatriusException
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)config
- frames configuration to usePatriusException
- if some frame specific error occurspublic Transform getTransformTo(Frame destination, AbsoluteDate date, FramesConfiguration config, boolean computeSpinDerivatives) throws PatriusException
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)config
- frames configuration to usecomputeSpinDerivatives
- spin derivatives are computed : true, or not : falsePatriusException
- if some frame specific error occurspublic TransformProvider getTransformProvider()
public boolean isChildOf(Frame potentialAncestor)
potentialAncestor
- supposed ancestor frameprotected static CelestialBodyFrame getRoot()
public Frame getFrozenFrame(Frame reference, AbsoluteDate freezingDate, String frozenName) throws PatriusException
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.
reference
- frame with respect to which the instance will be frozenfreezingDate
- freezing datefrozenName
- name of the frozen framePatriusException
- if transform between reference frame and instance cannot be computed at freezing framepublic RealMatrix getTransformJacobian(Frame to, AbsoluteDate date) throws PatriusException
to
- target framedate
- datePatriusException
- Failed to compute frame transformationpublic PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame) throws PatriusException
PVCoordinates
of the frame origin in the selected frame.getPVCoordinates
in interface PVCoordinatesProvider
date
- current dateframe
- the frame where to define the positionPatriusException
- if position cannot be computed in given framepublic Frame getNativeFrame(AbsoluteDate date, Frame frame) throws PatriusException
getNativeFrame
in interface PVCoordinatesProvider
date
- a dateframe
- a framePatriusException
- thrown if native frame is undefined or unknownpublic final void setName(String name)
name
- frame namepublic void setReferential(Frame referentialIn)
referentialIn
- referential of the frame to setpublic Frame getFirstPseudoInertialAncestor()
OrphanFrame
, it cannot be null
since root frame is ICRF which is inertial.public Frame getFirstCommonPseudoInertialAncestor(Frame frame)
OrphanFrame
, it cannot be null since root frame is ICRF which is inertial.frame
- a frameCopyright © 2023 CNES. All rights reserved.