|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bristol.star.cdf.TtScaler
public abstract class TtScaler
Handles conversions between TT_TIME2000 (TT since J2000.0) and Unix (UTC since 1970-01-01) times. An instance of this class is valid for a certain range of TT2000 dates (one that does not straddle a leap second). To convert between TT_TIME2000 and Unix time, first acquire the right instance of this class for the given time, and then use it for the conversion.
An external leap seconds table can be referenced with the "CDF_LEAPSECONDSTABLE" environment variable in exactly the same way as for the NASA library. Otherwise an internal leap seconds table will be used.
Field Summary | |
---|---|
static double |
J2000_UNIXMILLIS
Date of the J2000 epoch (2000-01-01T12:00:00) as a Unix time. |
static java.lang.String |
LEAP_FILE_ENV
Environment variable to locate external leap seconds file ("CDF_LEAPSECONDSTABLE"). |
Constructor Summary | |
---|---|
TtScaler(double fixOffset,
double scaleBase,
double scaleFactor,
long fromTt2kMillis,
long toTt2kMillis)
Constructor. |
Method Summary | |
---|---|
int |
compareTt2kMillis(long tt2kMillis)
Assesses validity of this scaler for a given time. |
long |
getFromTt2kMillis()
Returns the start of the validity range of this scaler in TT milliseconds since J2000. |
static int |
getScalerIndex(long tt2kMillis,
TtScaler[] orderedScalers,
int i0)
Searches an ordered array of scaler instances for one that is applicable to a supplied TT time. |
long |
getToTt2kMillis()
Returns the end of the validity range of this scaler in TT milliseconds since J2000. |
static TtScaler[] |
getTtScalers()
Returns an ordered list of scalers covering the whole range of times. |
abstract int |
millisIntoLeapSecond(long tt2kMillis)
Indicates whether and how far a given time is into the duration of a leap second. |
double |
tt2kToUnixMillis(long tt2kMillis)
Converts time in milliseconds from TT since J2000 to UTC since 1970 for this scaler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double J2000_UNIXMILLIS
public static final java.lang.String LEAP_FILE_ENV
Constructor Detail |
---|
public TtScaler(double fixOffset, double scaleBase, double scaleFactor, long fromTt2kMillis, long toTt2kMillis)
fixOffset
- fixed offset of UTC in seconds from TAIscaleBase
- MJD base for scalingscaleFactor
- factor for scalingfromTt2kMillis
- start of validity range
in TT milliseconds since J2000toTt2kMillis
- end of validity range
in TT milliseconds since J2000Method Detail |
---|
public double tt2kToUnixMillis(long tt2kMillis)
tt2kMillis
- TT milliseconds since J2000
public long getFromTt2kMillis()
public long getToTt2kMillis()
public int compareTt2kMillis(long tt2kMillis)
tt2kMillis
- TT milliseconds since J2000
public abstract int millisIntoLeapSecond(long tt2kMillis)
tt2kMillis
- TT time in milliseconds since J2000
public static int getScalerIndex(long tt2kMillis, TtScaler[] orderedScalers, int i0)
getTtScalers()
is suitable
and most likely what you want to use here.
tt2kMillis
- TT time in milliseconds since J2000orderedScalers
- list of TtScaler instances ordered in timei0
- initial guess at index of the right answer;
if negative no best guess is assumedpublic static TtScaler[] getTtScalers()
compareTt2kMillis(long)
method;
every long tt2kMillis
value will be valid for one of
the list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |