Public Types | Public Member Functions | Protected Member Functions | List of all members
gnsstk::EngAlmanac Class Reference

Detailed Description

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>

Inheritance diagram for gnsstk::EngAlmanac:
Inheritance graph
[legend]

Public Types

typedef std::map< short, unsigned char, std::less< short > > SVBitsMap
 Map PRN to bits (e.g. health bits). More...
 
- Public Types inherited from gnsstk::EngNav
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...
 
- Public Member Functions inherited from gnsstk::EngNav
 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 Public Member Functions inherited from gnsstk::EngNav
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
 

Member Typedef Documentation

◆ SVBitsMap

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.

Constructor & Destructor Documentation

◆ EngAlmanac()

gnsstk::EngAlmanac::EngAlmanac ( )
noexcept

Default constructor, blank almanac.

Definition at line 63 of file EngAlmanac.cpp.

◆ ~EngAlmanac()

virtual gnsstk::EngAlmanac::~EngAlmanac ( )
inlinevirtual

Destructor.

Definition at line 82 of file EngAlmanac.hpp.

Member Function Documentation

◆ addSubframe() [1/2]

bool gnsstk::EngAlmanac::addSubframe ( const long  subframe[10],
const int  gpsWeek 
)

Store a subframe in this object.

Parameters
subframeten word navigation subframe stored in the 30 least-significant bits of each array index.
gpsWeekfull GPS week number.
Returns
true if successful.
Exceptions
InvalidParameterif subframe is valid but not subframe 4-5.

Definition at line 84 of file EngAlmanac.cpp.

◆ addSubframe() [2/2]

bool gnsstk::EngAlmanac::addSubframe ( const uint32_t  subframe[10],
const short  gpsWeek 
)

Store a subframe in this object.

Parameters
subframeten word navigation subframe stored in the 30 least-significant bits of each array index.
gpsWeekfull GPS week number.
Returns
true if successful.
Exceptions
InvalidParameterif subframe is valid but not subframe 4-5.

Definition at line 93 of file EngAlmanac.cpp.

◆ check()

bool gnsstk::EngAlmanac::check ( std::ostream &  s) const

Definition at line 438 of file EngAlmanac.cpp.

◆ checkSVHere()

void gnsstk::EngAlmanac::checkSVHere ( SatID  sat) const
protected

This function is used to make sure data is present before accessing it.

Exceptions
SVNotPresentException

◆ dump()

void gnsstk::EngAlmanac::dump ( std::ostream &  s = std::cout,
bool  checkFlag = true 
) const

Definition at line 468 of file EngAlmanac.cpp.

◆ get6bitHealth()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 226 of file EngAlmanac.cpp.

◆ getA()

double gnsstk::EngAlmanac::getA ( SatID  sat) const

This function returns the value of the semi-major axis in meters for the specified PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 270 of file EngAlmanac.cpp.

◆ getAf0()

double gnsstk::EngAlmanac::getAf0 ( SatID  sat) const

This function returns the SV clock error in seconds for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 307 of file EngAlmanac.cpp.

◆ getAf1()

double gnsstk::EngAlmanac::getAf1 ( SatID  sat) const

This function returns the SV clock drift in seconds/seconds for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 317 of file EngAlmanac.cpp.

◆ getAhalf()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 261 of file EngAlmanac.cpp.

◆ getAlmOrbElem()

AlmOrbit gnsstk::EngAlmanac::getAlmOrbElem ( SatID  sat) const

This function returns an object containing all of the almanac orbit elements for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 400 of file EngAlmanac.cpp.

◆ getAlmOrbElems()

AlmOrbits gnsstk::EngAlmanac::getAlmOrbElems ( ) const
inline

This function returns an object containing all of the almanac orbit elements.

Definition at line 266 of file EngAlmanac.hpp.

◆ getAlmWeek()

short gnsstk::EngAlmanac::getAlmWeek ( ) const
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.

◆ getEcc()

double gnsstk::EngAlmanac::getEcc ( SatID  sat) const

This function returns the value of the eccentricity for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 198 of file EngAlmanac.cpp.

◆ getFullWeek()

short gnsstk::EngAlmanac::getFullWeek ( SatID  sat) const

This function returns the value of the week of the page transmission for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 352 of file EngAlmanac.cpp.

◆ getIOffset()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 207 of file EngAlmanac.cpp.

◆ getIon()

void gnsstk::EngAlmanac::getIon ( double  a[4],
double  b[4] 
) const

Get the ionospheric parameters.

Exceptions
InvalidRequestif the almanac page isn't present

Definition at line 360 of file EngAlmanac.cpp.

◆ getM0()

double gnsstk::EngAlmanac::getM0 ( SatID  sat) const

This function returns the value of the mean anomaly in radians for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 298 of file EngAlmanac.cpp.

◆ getOmega0()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 279 of file EngAlmanac.cpp.

◆ getOmegadot()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 216 of file EngAlmanac.cpp.

◆ getSVConfig()

short gnsstk::EngAlmanac::getSVConfig ( SatID  sat) const

This function returns the four-bit A/S-flag and configuration bits for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 248 of file EngAlmanac.cpp.

◆ getSVHealth()

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

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 239 of file EngAlmanac.cpp.

◆ getToa() [1/2]

double gnsstk::EngAlmanac::getToa ( ) const
noexcept

This function returns the value of the time of the almanac (from page 51) in GPS seconds of week.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 327 of file EngAlmanac.cpp.

◆ getToa() [2/2]

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 332 of file EngAlmanac.cpp.

◆ getUTC()

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.

Exceptions
InvalidRequestif the almanac page isn't present

Definition at line 375 of file EngAlmanac.cpp.

◆ getW()

double gnsstk::EngAlmanac::getW ( SatID  sat) const

This function returns the value of the argument of perigee in radians for the given PRN.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 289 of file EngAlmanac.cpp.

◆ getXmitTime()

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.

Exceptions
SVNotPresentExceptionif almanac page for the given PRN isn't present.

Definition at line 342 of file EngAlmanac.cpp.

◆ isData()

bool gnsstk::EngAlmanac::isData ( SatID  sat) const
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.

◆ operator!=()

bool gnsstk::EngAlmanac::operator!= ( const EngAlmanac )
private

◆ operator<()

bool gnsstk::EngAlmanac::operator< ( const EngAlmanac )
private

◆ operator==()

bool gnsstk::EngAlmanac::operator== ( const EngAlmanac )
private

◆ operator>()

bool gnsstk::EngAlmanac::operator> ( const EngAlmanac )
private

◆ svXvt() [1/2]

Xvt gnsstk::EngAlmanac::svXvt ( SatID  sat,
const CommonTime t 
) const

Compute satellite velocity/position at the given time using this almanac.

Parameters
satSatID of satellite to get velocity/position of.
ttime at which to compute SV position.
Exceptions
SVNotPresentException

Definition at line 409 of file EngAlmanac.cpp.

◆ svXvt() [2/2]

Xvt gnsstk::EngAlmanac::svXvt ( short  prn,
const CommonTime t 
) const
inline
Deprecated:
use the SatID version
Exceptions
SVNotPresentException

Definition at line 280 of file EngAlmanac.hpp.

Member Data Documentation

◆ A0

double gnsstk::EngAlmanac::A0
protected

Bias term of difference polynomial.

Definition at line 303 of file EngAlmanac.hpp.

◆ A1

double gnsstk::EngAlmanac::A1
protected

Drift term of difference polynomial.

Definition at line 304 of file EngAlmanac.hpp.

◆ alm_wk

short gnsstk::EngAlmanac::alm_wk
protected

wn_a plus the upper bits from a full week number.

Definition at line 314 of file EngAlmanac.hpp.

◆ almPRN

AlmOrbits gnsstk::EngAlmanac::almPRN
protected

Definition at line 323 of file EngAlmanac.hpp.

◆ alpha

double gnsstk::EngAlmanac::alpha[4]
protected

Definition at line 297 of file EngAlmanac.hpp.

◆ beta

double gnsstk::EngAlmanac::beta[4]
protected

Definition at line 298 of file EngAlmanac.hpp.

◆ dn

unsigned char gnsstk::EngAlmanac::dn
protected

reference day # of future leap second

Definition at line 316 of file EngAlmanac.hpp.

◆ dt_ls

double gnsstk::EngAlmanac::dt_ls
protected

time increment due to leap seconds

Definition at line 305 of file EngAlmanac.hpp.

◆ dt_lsf

double gnsstk::EngAlmanac::dt_lsf
protected

scheduled future time increment due to leap seconds

Definition at line 306 of file EngAlmanac.hpp.

◆ haveUTC

bool gnsstk::EngAlmanac::haveUTC
protected

Definition at line 324 of file EngAlmanac.hpp.

◆ health

SVBitsMap gnsstk::EngAlmanac::health
protected

satellite health array

Definition at line 317 of file EngAlmanac.hpp.

◆ special_msg

std::string gnsstk::EngAlmanac::special_msg
protected

Special message from GPS.

Definition at line 318 of file EngAlmanac.hpp.

◆ SV_config

SVBitsMap gnsstk::EngAlmanac::SV_config
protected

4 bit anti-spoofing/SV config sats.

Definition at line 320 of file EngAlmanac.hpp.

◆ t_oa

long gnsstk::EngAlmanac::t_oa
protected

Toa from page id 51 (subframe 5, pg 25)

Definition at line 309 of file EngAlmanac.hpp.

◆ t_ot

long gnsstk::EngAlmanac::t_ot
protected

reference time

Definition at line 308 of file EngAlmanac.hpp.

◆ wn_a

short gnsstk::EngAlmanac::wn_a
protected

The 8 bit GPS week of the Almanac from SF5, PG 25

Definition at line 312 of file EngAlmanac.hpp.

◆ wn_lsf

int gnsstk::EngAlmanac::wn_lsf
protected

week number of last/next leap second

Definition at line 311 of file EngAlmanac.hpp.

◆ wn_t

int gnsstk::EngAlmanac::wn_t
protected

reference week of current leap second

Definition at line 310 of file EngAlmanac.hpp.


The documentation for this class was generated from the following files:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44