public abstract class TtScaler
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
TtScaler(double fixOffset,
double scaleBase,
double scaleFactor,
long fromTt2kMillis,
long toTt2kMillis)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final double J2000_UNIXMILLIS
public static final java.lang.String LEAP_FILE_ENV
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 J2000public double tt2kToUnixMillis(long tt2kMillis)
tt2kMillis
- TT milliseconds since J2000public long getFromTt2kMillis()
public long getToTt2kMillis()
public int compareTt2kMillis(long tt2kMillis)
tt2kMillis
- TT milliseconds since J2000public abstract int millisIntoLeapSecond(long tt2kMillis)
tt2kMillis
- TT time in milliseconds since J2000public 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.