public final class LeapSecondFile extends Object
This example shows how to load leap second data from a file and use it in the current calculation context:
LeapSecondsFacet leapSeconds = LeapSecondFile.readLeapSeconds(filename);
leapSeconds.useInCurrentContext();
This example shows how to download leap second data over the internet from an AGI server, and use it in the current calculation context:
LeapSecondsFacet leapSeconds = LeapSecondFile.downloadLeapSeconds();
leapSeconds.useInCurrentContext();
The LeapSecond.dat file is an ASCII text file which contains the dates of all historical and announced leap seconds that would affect the conversion between the UTC time scale and other time scales.
The latest file containing all known leap seconds can be found at https://ftp.agi.com/pub/STKData/Astro/LeapSecond.dat. The information in the file is obtained from the U.S Naval Observatory leap second information file.
The format of the LeapSecond.dat file consists of an initial line with an integer value indicating the number of leap second entries that the file contains, followed by a leap second entry on each subsequent line of the file.
A leap second entry consists of the following space-delimited information:
The following is an example of a leap second file in this format:
28
1972 JAN 1 2441317.5 10.0 41317. 0.0
1972 JUL 1 2441499.5 11.0 41317. 0.0
1973 JAN 1 2441683.5 12.0 41317. 0.0
1974 JAN 1 2442048.5 13.0 41317. 0.0
1975 JAN 1 2442413.5 14.0 41317. 0.0
1976 JAN 1 2442778.5 15.0 41317. 0.0
1977 JAN 1 2443144.5 16.0 41317. 0.0
1978 JAN 1 2443509.5 17.0 41317. 0.0
1979 JAN 1 2443874.5 18.0 41317. 0.0
1980 JAN 1 2444239.5 19.0 41317. 0.0
1981 JUL 1 2444786.5 20.0 41317. 0.0
1982 JUL 1 2445151.5 21.0 41317. 0.0
1983 JUL 1 2445516.5 22.0 41317. 0.0
1985 JUL 1 2446247.5 23.0 41317. 0.0
1988 JAN 1 2447161.5 24.0 41317. 0.0
1990 JAN 1 2447892.5 25.0 41317. 0.0
1991 JAN 1 2448257.5 26.0 41317. 0.0
1992 JUL 1 2448804.5 27.0 41317. 0.0
1993 JUL 1 2449169.5 28.0 41317. 0.0
1994 JUL 1 2449534.5 29.0 41317. 0.0
1996 JAN 1 2450083.5 30.0 41317. 0.0
1997 JUL 1 2450630.5 31.0 41317. 0.0
1999 JAN 1 2451179.5 32.0 41317. 0.0
2006 JAN 1 2453736.5 33.0 41317. 0.0
2009 JAN 1 2454832.5 34.0 41317. 0.0
2012 JUL 1 2456109.5 35.0 41317. 0.0
2015 JUL 1 2457204.5 36.0 41317. 0.0
2017 JAN 1 2457754.5 37.0 41317. 0.0
EarthOrientationParametersFile
contains
EarthOrientationParameters
which describe the motion of the Earth's spin axis (pole wander) and the irregular rotation rate
of the Earth. These parameters are used in the computation of the transformation between
the Earth centered fixed reference frame and Earth centered inertial frames.
At the time of a leap second, the time history of the Earth's irregular rotation rate experiences
a discontinuity of 1 second.
It is therefore important that the Earth orientation parameters and leap second information
be updated together to properly establish the existence of the new leap second.
Modifier and Type | Method and Description |
---|---|
static LeapSecondsFacet |
downloadLeapSeconds()
Downloads the latest leap second file (LeapSecond.dat) from an AGI server.
|
static LeapSecondsFacet |
downloadLeapSeconds(Proxy proxy)
Downloads the latest leap second file (LeapSecond.dat) from an AGI server.
|
static LeapSecondsFacet |
readLeapSeconds(BufferedReader source)
Reads an STK leap second file and returns a new
LeapSecondsFacet instance
initialized with the contents of the file. |
static LeapSecondsFacet |
readLeapSeconds(String fileName)
Reads an STK leap second file and returns a new
LeapSecondsFacet instance
initialized with the contents of the file. |
static void |
writeLeapSeconds(Writer writer,
LeapSecondsFacet leapSeconds)
Writes the specified
LeapSecondsFacet instance to a stream in
STK leap second file format. |
@Nonnull public static LeapSecondsFacet downloadLeapSeconds()
Note that an internet connection is required to use this method successfully.
LeapSecondsFacet
initialized with the contents of the file.InvalidDataException
- Thrown when there is an error parsing the leap second data.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static LeapSecondsFacet downloadLeapSeconds(@Nullable Proxy proxy)
Note that an internet connection is required to use this method successfully.
proxy
- Proxy to use when connecting. Optional, default is null.LeapSecondsFacet
initialized with the contents of the file.InvalidDataException
- Thrown when there is an error parsing the leap second data.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static LeapSecondsFacet readLeapSeconds(@Nonnull String fileName)
LeapSecondsFacet
instance
initialized with the contents of the file.fileName
- The name of the file from which to read.LeapSecondsFacet
initialized with the contents of the file.ArgumentNullException
- Thrown when fileName
is null
.InvalidDataException
- Thrown when there is an error parsing the leap second data.@Nonnull public static LeapSecondsFacet readLeapSeconds(@Nonnull BufferedReader source)
LeapSecondsFacet
instance
initialized with the contents of the file.source
- The stream from which to read.LeapSecondsFacet
initialized with the contents of the file.ArgumentNullException
- Thrown when source
is null
.InvalidDataException
- Thrown when there is an error parsing the leap second data.public static void writeLeapSeconds(@Nonnull Writer writer, @Nonnull LeapSecondsFacet leapSeconds)
LeapSecondsFacet
instance to a stream in
STK leap second file format.writer
- The writer to which data will be written.leapSeconds
- The leap second data to write.ArgumentNullException
- Thrown when writer
or leapSeconds
is null
.