Class SatelliteClockScale
- java.lang.Object
-
- org.orekit.time.SatelliteClockScale
-
- All Implemented Interfaces:
Serializable
,TimeScale
public class SatelliteClockScale extends Object implements TimeScale
Scale for on-board clock.- Since:
- 11.0
- Author:
- Luc Maisonobe
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SatelliteClockScale(String name, AbsoluteDate epoch, TimeScale epochScale, double countAtEpoch, double drift)
Create a linear model for satellite clock.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
countAtDate(AbsoluteDate date)
Compute clock count corresponding to some date.AbsoluteDate
dateAtCount(double count)
Compute date corresponding to some clock count.String
getName()
Get the name time scale.double
offsetFromTAI(AbsoluteDate date)
Get the offset to convert locations fromTAIScale
to instance.<T extends CalculusFieldElement<T>>
ToffsetFromTAI(FieldAbsoluteDate<T> date)
Get the offset to convert locations fromTAIScale
to instance.double
offsetToTAI(DateComponents date, TimeComponents time)
Get the offset to convert locations from instance toTAIScale
.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.orekit.time.TimeScale
getLeap, getLeap, insideLeap, insideLeap, minuteDuration, minuteDuration
-
-
-
-
Constructor Detail
-
SatelliteClockScale
public SatelliteClockScale(String name, AbsoluteDate epoch, TimeScale epochScale, double countAtEpoch, double drift)
Create a linear model for satellite clock.Beware that we specify the model using its drift with respect to flow of time. For a perfect clock without any drift, the clock count would be one tick every SI second. A clock that is fast, say for example it generates 1000001 ticks every 1000000 SI second, would have a rate of 1.000001 tick per SI second and hence a drift of 1.0e-6 tick per SI second. In this constructor we use the drift (1.0e-6 in the previous example) rather than the rate (1.000001 in the previous example) to specify the clock. The rationale is that for clocks that are intended to be used for representing absolute time, the drift is expected to be small (much smaller that 1.0e-6 for a good clock), so using drift is numerically more stable than using rate and risking catastrophic cancellation when subtracting 1.0 in the internal computation.
Despite what is explained in the previous paragraph, this class can handle spacecraft clocks that are not intended to be synchronized with SI seconds, for example clocks that ticks at 10 Hz. In such cases the drift would need to be set at 10.0 - 1.0 = 9.0, which is not intuitive. For these clocks, the methods
countAtDate(AbsoluteDate)
anddateAtCount(double)
and perhapsoffsetFromTAI(AbsoluteDate)
are still useful, whereasoffsetToTAI(DateComponents, TimeComponents)
is probably not really meaningful.- Parameters:
name
- of the scaleepoch
- reference epochepochScale
- time scale in which theepoch
was definedcountAtEpoch
- clock count atepoch
drift
- clock drift rate (i.e. clock count change per SI second minus 1.0)
-
-
Method Detail
-
offsetFromTAI
public double offsetFromTAI(AbsoluteDate date)
Get the offset to convert locations fromTAIScale
to instance.- Specified by:
offsetFromTAI
in interfaceTimeScale
- Parameters:
date
- conversion date- Returns:
- offset in seconds to add to a location in
TAIScale
time scale to get a location in instance time scale - See Also:
TimeScale.offsetToTAI(DateComponents, TimeComponents)
-
offsetToTAI
public double offsetToTAI(DateComponents date, TimeComponents time)
Get the offset to convert locations from instance toTAIScale
.- Specified by:
offsetToTAI
in interfaceTimeScale
- Parameters:
date
- date location in the time scaletime
- time location in the time scale- Returns:
- offset in seconds to add to a location in instance time scale
to get a location in
TAIScale
time scale - See Also:
TimeScale.offsetFromTAI(AbsoluteDate)
-
dateAtCount
public AbsoluteDate dateAtCount(double count)
Compute date corresponding to some clock count.- Parameters:
count
- clock count- Returns:
- date at
count
-
countAtDate
public double countAtDate(AbsoluteDate date)
Compute clock count corresponding to some date.- Parameters:
date
- date- Returns:
- clock count at
date
-
offsetFromTAI
public <T extends CalculusFieldElement<T>> T offsetFromTAI(FieldAbsoluteDate<T> date)
Get the offset to convert locations fromTAIScale
to instance.- Specified by:
offsetFromTAI
in interfaceTimeScale
- Type Parameters:
T
- type of the filed elements- Parameters:
date
- conversion date- Returns:
- offset in seconds to add to a location in
TAIScale
time scale to get a location in instance time scale - See Also:
TimeScale.offsetToTAI(DateComponents, TimeComponents)
-
getName
public String getName()
Get the name time scale.
-
-