public final class SemAlmanac extends BaseCollection<SemAlmanacRecord>
Constructor and Description |
---|
SemAlmanac()
Initializes a new instance containing no data.
|
Modifier and Type | Method and Description |
---|---|
PlatformCollection |
createSatelliteCollection()
Creates a GPS satellite for each record in the SEM almanac.
|
static SemAlmanac |
downloadAlmanac(JulianDate dateOfAlmanac)
Downloads the SEM Almanac which was most recently published before the given date from an AGI server and returns the contents of the file as a
SemAlmanac . |
static SemAlmanac |
downloadAlmanac(JulianDate dateOfAlmanac,
Proxy proxy)
Downloads the SEM Almanac which was most recently published before the given date from an AGI server and returns the contents of the file as a
SemAlmanac . |
static SemAlmanac |
downloadLatestAlmanac()
Downloads the latest almanac from an AGI server.
|
static SemAlmanac |
downloadLatestAlmanac(Proxy proxy)
Downloads the latest almanac from an AGI server.
|
static String |
downloadLatestRawAlmanac()
Downloads the SEM Almanac from an AGI server and returns the contents of the file as a string.
|
static String |
downloadLatestRawAlmanac(Proxy proxy)
Downloads the SEM Almanac from an AGI server and returns the contents of the file as a string.
|
static String |
downloadRawAlmanac(JulianDate dateOfAlmanac)
Downloads the SEM Almanac which was most recently published before the given date from an AGI server and returns the contents of the file as a string.
|
static String |
downloadRawAlmanac(JulianDate dateOfAlmanac,
Proxy proxy)
Downloads the SEM Almanac which was most recently published before the given date from an AGI server and returns the contents of the file as a string.
|
SemAlmanacRecord |
findRecordByPrn(int prn)
Finds the record corresponding to a particular PRN.
|
String |
getAlmanacName()
Gets the name of the almanac as defined in the almanac file.
|
GlobalPositioningSystemDate |
getEpoch()
Gets the epoch of the almanac, which is the time at which the almanac
curve fit was performed.
|
int |
getNumberOfSatellites()
Gets the number of SVs in the almanac.
|
static SemAlmanac |
readFrom(BufferedReader reader,
int rolloverCount)
Reads a SEM almanac from the specified reader.
|
static SemAlmanac |
readFrom(String fileName,
int rolloverCount)
Reads a SEM almanac from the specified file.
|
add, add, addAll, addAll, clear, clearItems, contains, containsAll, get, getItems, indexOf, insertItem, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeItem, retainAll, set, setItem, size, subList, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public SemAlmanac()
SemAlmanac.readFrom(String,int)
to read data
from a SEM almanac file.@Nonnull public static SemAlmanac readFrom(@Nonnull String fileName, int rolloverCount)
The following list represents the rollover dates for the GPS week parameter. On or after the date listed below, you will need to use the specified rollover count.
Date | Rollover Count |
---|---|
January 6, 1980 | 0 |
August 22, 1999 | 1 |
April 7, 2019 | 2 |
November 21, 2038 | 3 |
July 7, 2058 | 4 |
To compute the rollover count for a given date, construct a
GlobalPositioningSystemDate
and use the value of
RolloverCount
(get
/ set
).
fileName
- The name of the file from which to read the almanac.rolloverCount
- The number of times the GPS week counter had rolled over when this almanac was created.
See below for more information.ArgumentNullException
- Thrown when fileName
is null
.InvalidDataException
- Thrown when the SEM almanac data has an invalid format.@Nonnull public static SemAlmanac readFrom(@Nonnull BufferedReader reader, int rolloverCount)
The following list represents the rollover dates for the GPS week parameter. On or after the date listed below, you will need to use the specified rollover count.
Date | Rollover Count |
---|---|
January 6, 1980 | 0 |
August 22, 1999 | 1 |
April 7, 2019 | 2 |
November 21, 2038 | 3 |
July 7, 2058 | 4 |
To compute the rollover count for a given date, construct a
GlobalPositioningSystemDate
and use the value of
RolloverCount
(get
/ set
).
reader
- The reader from which to read the almanac.rolloverCount
- The number of times the GPS week counter had rolled over when this almanac was created.
See below for more information.ArgumentNullException
- Thrown when reader
is null
.InvalidDataException
- Thrown when the SEM almanac data has an invalid format.@Nonnull public static SemAlmanac downloadLatestAlmanac()
Note that an internet connection is required to use this method successfully.
SemAlmanac
that contains data from the latest almanac.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static SemAlmanac downloadLatestAlmanac(@Nullable Proxy proxy)
Note that an internet connection is required to use this method successfully.
proxy
- Proxy to use when connecting.SemAlmanac
that contains data from the latest almanac.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static String downloadLatestRawAlmanac()
Note that an internet connection is required to use this method successfully.
DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static String downloadLatestRawAlmanac(@Nullable Proxy proxy)
Note that an internet connection is required to use this method successfully.
proxy
- Proxy to use when connecting.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static SemAlmanac downloadAlmanac(@Nonnull JulianDate dateOfAlmanac)
SemAlmanac
.
This method connects via HTTPS to ftp.agi.com.
Note that an internet connection is required to use this method successfully.
dateOfAlmanac
- The date for which the almanac is needed.SemAlmanac
that contains data from the almanac most recently published before dateOfAlmanac
.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static SemAlmanac downloadAlmanac(@Nonnull JulianDate dateOfAlmanac, @Nullable Proxy proxy)
SemAlmanac
.
This method connects via HTTPS to ftp.agi.com.
Note that an internet connection is required to use this method successfully.
dateOfAlmanac
- The date for which the almanac is needed.proxy
- Proxy to use when connecting.SemAlmanac
that contains data from the almanac most recently published before dateOfAlmanac
.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static String downloadRawAlmanac(@Nonnull JulianDate dateOfAlmanac)
Note that an internet connection is required to use this method successfully.
dateOfAlmanac
- The date for which the almanac is needed.dateOfAlmanac
.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nonnull public static String downloadRawAlmanac(@Nonnull JulianDate dateOfAlmanac, @Nullable Proxy proxy)
Note that an internet connection is required to use this method successfully.
dateOfAlmanac
- The date for which the almanac is needed.proxy
- Proxy to use when connecting.dateOfAlmanac
.DataUnavailableException
- Thrown when the data cannot be retrieved from the server.@Nullable public final SemAlmanacRecord findRecordByPrn(int prn)
prn
- The PRN to find.public final int getNumberOfSatellites()
public final String getAlmanacName()
@Nonnull public final GlobalPositioningSystemDate getEpoch()
@Nonnull public final PlatformCollection createSatelliteCollection()
GpsSatelliteExtension
instance for each
record in the SEM almanac, and they are found in the same order.