public class SatelliteClockScale extends Object implements TimeScale
Constructor and Description |
---|
SatelliteClockScale(String name,
AbsoluteDate epoch,
TimeScale epochScale,
double countAtEpoch,
double drift)
Create a linear model for satellite clock.
|
Modifier and Type | Method and 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 from
TAIScale to instance. |
<T extends CalculusFieldElement<T>> |
offsetFromTAI(FieldAbsoluteDate<T> date)
Get the offset to convert locations from
TAIScale to instance. |
double |
offsetToTAI(DateComponents date,
TimeComponents time)
Get the offset to convert locations from instance to
TAIScale . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLeap, getLeap, insideLeap, insideLeap, minuteDuration, minuteDuration
public SatelliteClockScale(String name, AbsoluteDate epoch, TimeScale epochScale, double countAtEpoch, double drift)
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)
and
dateAtCount(double)
and perhaps offsetFromTAI(AbsoluteDate)
are still useful, whereas offsetToTAI(DateComponents, TimeComponents)
is probably not really meaningful.
name
- of the scaleepoch
- reference epochepochScale
- time scale in which the epoch
was definedcountAtEpoch
- clock count at epoch
drift
- clock drift rate (i.e. clock count change per SI second minus 1.0)public double offsetFromTAI(AbsoluteDate date)
TAIScale
to instance.offsetFromTAI
in interface TimeScale
date
- conversion dateTAIScale
time scale to get a location in instance time scaleTimeScale.offsetToTAI(DateComponents, TimeComponents)
public double offsetToTAI(DateComponents date, TimeComponents time)
TAIScale
.offsetToTAI
in interface TimeScale
date
- date location in the time scaletime
- time location in the time scaleTAIScale
time scaleTimeScale.offsetFromTAI(AbsoluteDate)
public AbsoluteDate dateAtCount(double count)
count
- clock countcount
public double countAtDate(AbsoluteDate date)
date
- datedate
public <T extends CalculusFieldElement<T>> T offsetFromTAI(FieldAbsoluteDate<T> date)
TAIScale
to instance.offsetFromTAI
in interface TimeScale
T
- type of the filed elementsdate
- conversion dateTAIScale
time scale to get a location in instance time scaleTimeScale.offsetToTAI(DateComponents, TimeComponents)
public String getName()
Copyright © 2002-2021 CS GROUP. All rights reserved.