public class LeapSecondsConverter extends UnitsConverter
UnitsConverter.Appended, UnitsConverter.ScaleOffset
Modifier and Type | Field and Description |
---|---|
static int |
T1972_LEAP |
Constructor and Description |
---|
LeapSecondsConverter(boolean us2000ToTT2000) |
Modifier and Type | Method and Description |
---|---|
double |
convert(double value)
convert the value in the source units to the target units.
|
UnitsConverter |
getInverse() |
static int |
getLeapSecondCountForTT2000(long tt2000)
calculate the number of leap seconds in the tt2000 time.
|
static int |
getLeapSecondCountForUs2000(double us2000)
calculate the number of leap seconds in the us2000 time.
|
append, convert, getConverter
public static final int T1972_LEAP
public static int getLeapSecondCountForUs2000(double us2000) throws java.io.IOException
print getLeapSecondCountForUs2000( Units.us2000.parse('1972-01-01T00:00Z').doubleValue(Units.us2000) ) # results in 10
print getLeapSecondCountForUs2000( Units.us2000.parse('2017-01-01T00:00Z').doubleValue(Units.us2000) ) # results in 37
This is intended to replicate the table https://cdf.gsfc.nasa.gov/html/CDFLeapSeconds.txtus2000
- the time in us2000, which include the leap seconds.java.io.IOException
public static int getLeapSecondCountForTT2000(long tt2000) throws java.io.IOException
print getLeapSecondCountForTT2000( Units.cdfTT2000.parse('1972-01-01T00:00Z').doubleValue(Units.cdfTT2000) ) # results in 10
print getLeapSecondCountForTT2000( 0 ) # results in 32
print getLeapSecondCountForTT2000( Units.cdfTT2000.parse('2017-01-01T00:00Z').doubleValue(Units.cdfTT2000) ) # results in 37
This is intended to replicate the table https://cdf.gsfc.nasa.gov/html/CDFLeapSeconds.txttt2000
- the time in tt2000, which include the leap seconds.java.io.IOException
public UnitsConverter getInverse()
getInverse
in class UnitsConverter
public double convert(double value)
UnitsConverter
convert
in class UnitsConverter
value
- value in source units.