Almanac information for the GPS constellation. This class encapsulates the almanac navigation message (subframes 4 & 5) and provides functions to decode the as-broadcast almanac. It is possible for an EngAlmanac to not contain a complete set of pages.
Definition at line 71 of file EngAlmanac.hpp.
#include <EngAlmanac.hpp>
Public Types | |
typedef std::map< short, unsigned char, std::less< short > > | SVBitsMap |
Map PRN to bits (e.g. health bits). More... | |
![]() | |
enum | BitConvertType { BITS8 = 0, BITS10 = 1 } |
This enumeration is used by the convertXBit() method. More... | |
Public Member Functions | |
bool | addSubframe (const long subframe[10], const int gpsWeek) |
bool | addSubframe (const uint32_t subframe[10], const short gpsWeek) |
bool | check (std::ostream &s) const |
void | dump (std::ostream &s=std::cout, bool checkFlag=true) const |
EngAlmanac () noexcept | |
Default constructor, blank almanac. More... | |
short | get6bitHealth (SatID sat) const |
double | getA (SatID sat) const |
double | getAf0 (SatID sat) const |
double | getAf1 (SatID sat) const |
double | getAhalf (SatID sat) const |
AlmOrbit | getAlmOrbElem (SatID sat) const |
AlmOrbits | getAlmOrbElems () const |
short | getAlmWeek () const noexcept |
double | getEcc (SatID sat) const |
short | getFullWeek (SatID sat) const |
double | getIOffset (SatID sat) const |
void | getIon (double a[4], double b[4]) const |
double | getM0 (SatID sat) const |
double | getOmega0 (SatID sat) const |
double | getOmegadot (SatID sat) const |
short | getSVConfig (SatID sat) const |
short | getSVHealth (SatID sat) const |
double | getToa () const noexcept |
double | getToa (SatID sat) const |
void | getUTC (double &a0, double &a1, double &deltaTLS, long &tot, int &WNt, int &WNLSF, int &DN, double &deltaTLSF) const |
double | getW (SatID sat) const |
double | getXmitTime (SatID sat) const |
bool | isData (SatID sat) const noexcept |
Xvt | svXvt (SatID sat, const CommonTime &t) const |
Xvt | svXvt (short prn, const CommonTime &t) const |
virtual | ~EngAlmanac () |
Destructor. More... | |
![]() | |
EngNav () noexcept | |
default constructor More... | |
virtual | ~EngNav () |
destructor More... | |
Protected Member Functions | |
void | checkSVHere (SatID sat) const |
Protected Attributes | |
Ionosphere Parameters | |
double | alpha [4] |
double | beta [4] |
UTC Parameters | |
double | A0 |
Bias term of difference polynomial. More... | |
double | A1 |
Drift term of difference polynomial. More... | |
double | dt_ls |
time increment due to leap seconds More... | |
double | dt_lsf |
long | t_ot |
reference time More... | |
long | t_oa |
Toa from page id 51 (subframe 5, pg 25) More... | |
int | wn_t |
reference week of current leap second More... | |
int | wn_lsf |
week number of last/next leap second More... | |
short | wn_a |
short | alm_wk |
unsigned char | dn |
reference day # of future leap second More... | |
SVBitsMap | health |
satellite health array More... | |
std::string | special_msg |
Special message from GPS. More... | |
SVBitsMap | SV_config |
4 bit anti-spoofing/SV config sats. More... | |
AlmOrbits | almPRN |
bool | haveUTC |
bool | operator== (const EngAlmanac &) |
bool | operator!= (const EngAlmanac &) |
bool | operator< (const EngAlmanac &) |
bool | operator> (const EngAlmanac &) |
Additional Inherited Members | |
![]() | |
static bool | checkParity (const std::vector< uint32_t > &v, bool knownUpright=true) |
static bool | checkParity (const uint32_t input[10], bool knownUpright=true) |
static uint32_t | computeParity (uint32_t sfword, uint32_t psfword, bool knownUpright=true) |
static bool | convert10bit (int gpsWeek, double *out) noexcept |
static bool | convert8bit (int gpsWeek, double *out) noexcept |
static short | convertXBit (short fullGPSWeek, short incompleteGPSWeek, BitConvertType type) |
static void | dump (std::ostream &s=std::cout) |
static uint32_t | fixParity (uint32_t sfword, uint32_t psfword, bool nib, bool knownUpright=true) |
static uint32_t | getd29 (uint32_t sfword) |
Get bit 29 from the given subframe word. More... | |
static uint32_t | getd30 (uint32_t sfword) |
static unsigned long | getHOWTime (uint32_t word2) |
Get the HOW time from the provided HOW. More... | |
static bool | getNMCTValidity (const uint32_t sf2[10], unsigned howWeek, NMCTMeta &meta) |
static bool | getNMCTValidity (const uint32_t sf2[10], unsigned howWeek, uint32_t &aodo, CommonTime &tnmct, CommonTime &toe, CommonTime &tot) |
static short | getSFID (uint32_t word2) |
Get the subframe ID from the provided HOW. More... | |
static short | getSubframePattern (const long input[10]) noexcept |
static short | getSubframePattern (const uint32_t input[10]) noexcept |
static unsigned long | getTOW (uint32_t word2) |
Get the TOW count from the provided HOW. More... | |
static bool | sfpage2svid (short subframe, short page, short &svpgid) noexcept |
static bool | subframeConvert (const long input[10], int gpsWeek, double output[60]) noexcept |
static bool | subframeConvert (const uint32_t input[10], short gpsWeek, double output[60]) noexcept |
static bool | subframeParity (const long input[10]) |
This is the old routine only left around for compatibility. More... | |
static bool | sv2page (short svpgid, short &subframe, short &page) noexcept |
static bool | zcount2page (unsigned long zcount, short &subframe, short &page) noexcept |
typedef std::map<short, unsigned char, std::less<short> > gnsstk::EngAlmanac::SVBitsMap |
Map PRN to bits (e.g. health bits).
Definition at line 76 of file EngAlmanac.hpp.
|
noexcept |
Default constructor, blank almanac.
Definition at line 63 of file EngAlmanac.cpp.
|
inlinevirtual |
Destructor.
Definition at line 82 of file EngAlmanac.hpp.
Store a subframe in this object.
subframe | ten word navigation subframe stored in the 30 least-significant bits of each array index. |
gpsWeek | full GPS week number. |
InvalidParameter | if subframe is valid but not subframe 4-5. |
Definition at line 84 of file EngAlmanac.cpp.
Store a subframe in this object.
subframe | ten word navigation subframe stored in the 30 least-significant bits of each array index. |
gpsWeek | full GPS week number. |
InvalidParameter | if subframe is valid but not subframe 4-5. |
Definition at line 93 of file EngAlmanac.cpp.
bool gnsstk::EngAlmanac::check | ( | std::ostream & | s | ) | const |
Definition at line 438 of file EngAlmanac.cpp.
|
protected |
This function is used to make sure data is present before accessing it.
SVNotPresentException |
void gnsstk::EngAlmanac::dump | ( | std::ostream & | s = std::cout , |
bool | checkFlag = true |
||
) | const |
Definition at line 468 of file EngAlmanac.cpp.
short gnsstk::EngAlmanac::get6bitHealth | ( | SatID | sat | ) | const |
This function returns the value of the health of the given PRN from the general pages in the almanac. It return the shortened 6 bit health that is in those pages.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 226 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getA | ( | SatID | sat | ) | const |
This function returns the value of the semi-major axis in meters for the specified PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 270 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getAf0 | ( | SatID | sat | ) | const |
This function returns the SV clock error in seconds for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 307 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getAf1 | ( | SatID | sat | ) | const |
This function returns the SV clock drift in seconds/seconds for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 317 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getAhalf | ( | SatID | sat | ) | const |
This function returns the value of the square root of the semi-major axis in square root of meters for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 261 of file EngAlmanac.cpp.
This function returns an object containing all of the almanac orbit elements for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 400 of file EngAlmanac.cpp.
|
inline |
This function returns an object containing all of the almanac orbit elements.
Definition at line 266 of file EngAlmanac.hpp.
|
noexcept |
This function gets the week number for the almanac stored in this object. It is replaced when an almanac is converted to engineering units with the almWeek from the data. It also is replaced by the week number in the FIC data (if it is non zero) when addSF is used to add FIC data to the almanac. This is a full GPS week number (ie > 10 bits)
Definition at line 395 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getEcc | ( | SatID | sat | ) | const |
This function returns the value of the eccentricity for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 198 of file EngAlmanac.cpp.
short gnsstk::EngAlmanac::getFullWeek | ( | SatID | sat | ) | const |
This function returns the value of the week of the page transmission for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 352 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getIOffset | ( | SatID | sat | ) | const |
This function returns the value of the offset of the inclination from 54 degrees in radians for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 207 of file EngAlmanac.cpp.
void gnsstk::EngAlmanac::getIon | ( | double | a[4], |
double | b[4] | ||
) | const |
Get the ionospheric parameters.
InvalidRequest | if the almanac page isn't present |
Definition at line 360 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getM0 | ( | SatID | sat | ) | const |
This function returns the value of the mean anomaly in radians for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 298 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getOmega0 | ( | SatID | sat | ) | const |
This function returns the value of the right ascension of the ascending node in radians for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 279 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getOmegadot | ( | SatID | sat | ) | const |
This function returns the value of the rate of the right ascension of the ascending node in radians/second for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 216 of file EngAlmanac.cpp.
short gnsstk::EngAlmanac::getSVConfig | ( | SatID | sat | ) | const |
This function returns the four-bit A/S-flag and configuration bits for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 248 of file EngAlmanac.cpp.
short gnsstk::EngAlmanac::getSVHealth | ( | SatID | sat | ) | const |
This function returns the value of the health of the given PRN from the PRN specific page which might not be present. This is the full 8 bit health
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 239 of file EngAlmanac.cpp.
|
noexcept |
This function returns the value of the time of the almanac (from page 51) in GPS seconds of week.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 327 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getToa | ( | SatID | sat | ) | const |
This function returns the value of the time of the almanac in GPS seconds of week for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 332 of file EngAlmanac.cpp.
void gnsstk::EngAlmanac::getUTC | ( | double & | a0, |
double & | a1, | ||
double & | deltaTLS, | ||
long & | tot, | ||
int & | WNt, | ||
int & | WNLSF, | ||
int & | DN, | ||
double & | deltaTLSF | ||
) | const |
Get the UTC offset parameters.
InvalidRequest | if the almanac page isn't present |
Definition at line 375 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getW | ( | SatID | sat | ) | const |
This function returns the value of the argument of perigee in radians for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 289 of file EngAlmanac.cpp.
double gnsstk::EngAlmanac::getXmitTime | ( | SatID | sat | ) | const |
This function returns the value of the transmit time for this almanac data in seconds of week for the given PRN.
SVNotPresentException | if almanac page for the given PRN isn't present. |
Definition at line 342 of file EngAlmanac.cpp.
|
noexcept |
This function returns true if data is available for a given PRN. This data is accessed by the below accesser methods
Definition at line 418 of file EngAlmanac.cpp.
|
private |
|
private |
|
private |
|
private |
Xvt gnsstk::EngAlmanac::svXvt | ( | SatID | sat, |
const CommonTime & | t | ||
) | const |
Compute satellite velocity/position at the given time using this almanac.
sat | SatID of satellite to get velocity/position of. |
t | time at which to compute SV position. |
SVNotPresentException |
Definition at line 409 of file EngAlmanac.cpp.
|
inline |
SVNotPresentException |
Definition at line 280 of file EngAlmanac.hpp.
|
protected |
Bias term of difference polynomial.
Definition at line 303 of file EngAlmanac.hpp.
|
protected |
Drift term of difference polynomial.
Definition at line 304 of file EngAlmanac.hpp.
|
protected |
wn_a plus the upper bits from a full week number.
Definition at line 314 of file EngAlmanac.hpp.
|
protected |
Definition at line 323 of file EngAlmanac.hpp.
|
protected |
Definition at line 297 of file EngAlmanac.hpp.
|
protected |
Definition at line 298 of file EngAlmanac.hpp.
|
protected |
reference day # of future leap second
Definition at line 316 of file EngAlmanac.hpp.
|
protected |
time increment due to leap seconds
Definition at line 305 of file EngAlmanac.hpp.
|
protected |
scheduled future time increment due to leap seconds
Definition at line 306 of file EngAlmanac.hpp.
|
protected |
Definition at line 324 of file EngAlmanac.hpp.
|
protected |
satellite health array
Definition at line 317 of file EngAlmanac.hpp.
|
protected |
Special message from GPS.
Definition at line 318 of file EngAlmanac.hpp.
|
protected |
4 bit anti-spoofing/SV config sats.
Definition at line 320 of file EngAlmanac.hpp.
|
protected |
Toa from page id 51 (subframe 5, pg 25)
Definition at line 309 of file EngAlmanac.hpp.
|
protected |
reference time
Definition at line 308 of file EngAlmanac.hpp.
|
protected |
The 8 bit GPS week of the Almanac from SF5, PG 25
Definition at line 312 of file EngAlmanac.hpp.
|
protected |
week number of last/next leap second
Definition at line 311 of file EngAlmanac.hpp.
|
protected |
reference week of current leap second
Definition at line 310 of file EngAlmanac.hpp.