EngAlmanac Class Reference
[Ephemeris calculations]

#include <EngAlmanac.hpp>

Inheritance diagram for EngAlmanac:

Inheritance graph
[legend]
Collaboration diagram for EngAlmanac:

Collaboration graph
[legend]
List of all members.

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 64 of file EngAlmanac.hpp.

Public Types

typedef std::map< short, unsigned
char, std::less< short > > 
SVBitsMap
 Map PRN to bits (e.g. health bits).

Public Member Functions

 EngAlmanac () throw ()
 Default constructor, blank almanac.
virtual ~EngAlmanac ()
 Destructor.
bool addSubframe (const long subframe[10], const int gpsWeek) throw (gpstk::InvalidParameter)
 Store a subframe in this object.
bool isData (SatID sat) const throw ()
 This function returns true if data is available for a given PRN.
double getEcc (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the eccentricity for the given PRN.
double getIOffset (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the offset of the inclination from 54 degrees in radians for the given PRN.
double getOmegadot (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the rate of the right ascension of the ascending node in radians/second for the given PRN.
short get6bitHealth (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the health of the given PRN from the general pages in the almanac.
short getSVHealth (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the health of the given PRN from the PRN specific page which might not be present.
short getSVConfig (SatID sat) const throw (SVNotPresentException)
 This function returns the four-bit A/S-flag and configuration bits for the given PRN.
double getAhalf (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the square root of the semi-major axis in square root of meters for the given PRN.
double getA (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the semi-major axis in meters for the specified PRN.
double getOmega0 (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the right ascension of the ascending node in radians for the given PRN.
double getW (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the argument of perigee in radians for the given PRN.
double getM0 (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the mean anomaly in radians for the given PRN.
double getAf0 (SatID sat) const throw (SVNotPresentException)
 This function returns the SV clock error in seconds for the given PRN.
double getAf1 (SatID sat) const throw (SVNotPresentException)
 This function returns the SV clock drift in seconds/seconds for the given PRN.
double getToa () const throw ()
 This function returns the value of the time of the almanac (from page 51) in GPS seconds of week.
double getToa (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the time of the almanac in GPS seconds of week for the given PRN.
double getXmitTime (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the transmit time for this almanac data in seconds of week for the given PRN.
short getFullWeek (SatID sat) const throw (SVNotPresentException)
 This function returns the value of the week of the page transmission for the given PRN.
void getIon (double a[4], double b[4]) const throw (InvalidRequest)
 Get the ionospheric parameters.
void getUTC (double &a0, double &a1, double &deltaTLS, long &tot, int &WNt, int &WNLSF, int &DN, double &deltaTLSF) const throw (InvalidRequest)
 Get the UTC offset parameters.
short getAlmWeek () const throw ()
 This function gets the week number for the almanac stored in this object.
AlmOrbit getAlmOrbElem (SatID sat) const throw (SVNotPresentException)
 This function returns an object containing all of the almanac orbit elements for the given PRN.
AlmOrbits getAlmOrbElems () const
 This function returns an object containing all of the almanac orbit elements.
Xvt svXvt (SatID sat, const CommonTime &t) const throw (SVNotPresentException)
 Compute satellite velocity/position at the given time using this almanac.
Xvt svXvt (short prn, const CommonTime &t) const throw (SVNotPresentException)
void dump (std::ostream &s=std::cout, bool checkFlag=true) const
bool check (std::ostream &s) const

Protected Member Functions

void checkSVHere (SatID sat) const throw (SVNotPresentException)
 This function is used to make sure data is present before accessing it.

Protected Attributes

AlmOrbits almPRN
bool haveUTC
double alpha [4]
double beta [4]
double A0
 Bias term of difference polynomial.
double A1
 Drift term of difference polynomial.
double dt_ls
 time increment due to leap seconds
double dt_lsf
 scheduled future time increment due to leap seconds
long t_ot
 reference time
long t_oa
 Toa from page id 51 (subframe 5, pg 25).
int wn_t
 reference week of current leap second
int wn_lsf
 week number of last/next leap second
short alm_wk
 GPS Week of the Almanac from the last page of orbital data.
unsigned char dn
 reference day # of future leap second
SVBitsMap health
 satellite health array
std::string special_msg
 Special message from GPS.
SVBitsMap SV_config
 4 bit anti-spoofing/SV config sats


Member Typedef Documentation

typedef std::map<short, unsigned char, std::less<short> > SVBitsMap
 

Map PRN to bits (e.g. health bits).

Definition at line 82 of file EngAlmanac.hpp.


Constructor & Destructor Documentation

EngAlmanac  )  throw ()
 

Default constructor, blank almanac.

Definition at line 70 of file EngAlmanac.cpp.

References EngAlmanac::A0, EngAlmanac::A1, EngAlmanac::alm_wk, EngAlmanac::alpha, EngAlmanac::beta, EngAlmanac::dn, EngAlmanac::dt_ls, EngAlmanac::dt_lsf, EngAlmanac::haveUTC, EngAlmanac::t_oa, EngAlmanac::t_ot, EngAlmanac::wn_lsf, and EngAlmanac::wn_t.

virtual ~EngAlmanac  )  [inline, virtual]
 

Destructor.

Definition at line 88 of file EngAlmanac.hpp.


Member Function Documentation

bool addSubframe const long  subframe[10],
const int  gpsWeek
throw (gpstk::InvalidParameter)
 

Store a subframe in this object.

Parameters:
subframe ten word navigation subframe stored in the 30 least-significant bits of each array index.
gpsWeek full GPS week number.
Returns:
true if successful.
Exceptions:
InvalidParameter if subframe is valid but not subframe 4-5.

Definition at line 91 of file EngAlmanac.cpp.

References A1, gpstk::beta(), and GPSTK_THROW.

bool check std::ostream &  s  )  const
 

Definition at line 455 of file EngAlmanac.cpp.

References EngAlmanac::getToa().

Referenced by EngAlmanac::dump().

void checkSVHere SatID  sat  )  const throw (SVNotPresentException) [protected]
 

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

void dump std::ostream &  s = std::cout,
bool  checkFlag = true
const
 

Definition at line 485 of file EngAlmanac.cpp.

References EngAlmanac::A0, EngAlmanac::A1, EngAlmanac::alm_wk, EngAlmanac::almPRN, EngAlmanac::alpha, EngAlmanac::beta, EngAlmanac::check(), EngAlmanac::dn, EngAlmanac::dt_ls, EngAlmanac::dt_lsf, EngAlmanac::health, gpstk::StringUtils::hexDumpData(), gpstk::int2bin(), EngAlmanac::special_msg, EngAlmanac::SV_config, EngAlmanac::t_oa, EngAlmanac::t_ot, EngAlmanac::wn_lsf, and EngAlmanac::wn_t.

Referenced by gpstk::operator<<().

short get6bitHealth SatID  sat  )  const throw (SVNotPresentException)
 

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:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 226 of file EngAlmanac.cpp.

References GPSTK_THROW.

double getA SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 274 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getAf0 SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 315 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getAf1 SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 326 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getAhalf SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the square root of the semi-major axis in square root of meters for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 264 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

AlmOrbit getAlmOrbElem SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 415 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

AlmOrbits getAlmOrbElems  )  const [inline]
 

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

Definition at line 266 of file EngAlmanac.hpp.

short getAlmWeek  )  const throw ()
 

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 410 of file EngAlmanac.cpp.

double getEcc SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 195 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

short getFullWeek SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 364 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getIOffset SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the offset of the inclination from 54 degrees in radians for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 205 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

void getIon double  a[4],
double  b[4]
const throw (InvalidRequest)
 

Get the ionospheric parameters.

Exceptions:
InvalidRequest if the almanac page isn't present

Definition at line 373 of file EngAlmanac.cpp.

References gpstk::beta(), and GPSTK_THROW.

double getM0 SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 305 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getOmega0 SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the right ascension of the ascending node in radians for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 284 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getOmegadot SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the rate of the right ascension of the ascending node in radians/second for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 215 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

short getSVConfig SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 250 of file EngAlmanac.cpp.

References GPSTK_THROW.

short getSVHealth SatID  sat  )  const throw (SVNotPresentException)
 

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:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 240 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getToa SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the time of the almanac in GPS seconds of week for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 342 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getToa  )  const throw ()
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 337 of file EngAlmanac.cpp.

Referenced by EngAlmanac::check().

void getUTC double &  a0,
double &  a1,
double &  deltaTLS,
long &  tot,
int &  WNt,
int &  WNLSF,
int &  DN,
double &  deltaTLSF
const throw (InvalidRequest)
 

Get the UTC offset parameters.

Exceptions:
InvalidRequest if the almanac page isn't present

Definition at line 389 of file EngAlmanac.cpp.

References GPSTK_THROW.

double getW SatID  sat  )  const throw (SVNotPresentException)
 

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

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 295 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

double getXmitTime SatID  sat  )  const throw (SVNotPresentException)
 

This function returns the value of the transmit time for this almanac data in seconds of week for the given PRN.

Exceptions:
SVNotPresentException if almanac page for the given PRN isn't present.

Definition at line 353 of file EngAlmanac.cpp.

References CHECK_SV_HERE.

bool isData SatID  sat  )  const throw ()
 

This function returns true if data is available for a given PRN.

This data is accessed by the below accesser methods

Definition at line 435 of file EngAlmanac.cpp.

Xvt svXvt short  prn,
const CommonTime t
const throw (SVNotPresentException) [inline]
 

Deprecated:
use the SatID version

Definition at line 279 of file EngAlmanac.hpp.

Xvt svXvt SatID  sat,
const CommonTime t
const throw (SVNotPresentException)
 

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

Parameters:
sat SatID of satellite to get velocity/position of.
t time at which to compute SV position.
Exceptions:
InvalidRequest if a required subframe has not been stored.

Definition at line 425 of file EngAlmanac.cpp.

References CHECK_SV_HERE.


Member Data Documentation

double A0 [protected]
 

Bias term of difference polynomial.

Definition at line 302 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

double A1 [protected]
 

Drift term of difference polynomial.

Definition at line 303 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

short alm_wk [protected]
 

GPS Week of the Almanac from the last page of orbital data.

Definition at line 314 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

AlmOrbits almPRN [protected]
 

Definition at line 324 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump().

double alpha[4] [protected]
 

Definition at line 296 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

double beta[4] [protected]
 

Definition at line 297 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

unsigned char dn [protected]
 

reference day # of future leap second

Definition at line 316 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

double dt_ls [protected]
 

time increment due to leap seconds

Definition at line 304 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

double dt_lsf [protected]
 

scheduled future time increment due to leap seconds

Definition at line 305 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

bool haveUTC [protected]
 

Definition at line 325 of file EngAlmanac.hpp.

Referenced by EngAlmanac::EngAlmanac().

SVBitsMap health [protected]
 

satellite health array

Definition at line 318 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump().

std::string special_msg [protected]
 

Special message from GPS.

Definition at line 319 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump().

SVBitsMap SV_config [protected]
 

4 bit anti-spoofing/SV config sats

Definition at line 321 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump().

long t_oa [protected]
 

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

Definition at line 308 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

long t_ot [protected]
 

reference time

Definition at line 307 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

int wn_lsf [protected]
 

week number of last/next leap second

Definition at line 312 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().

int wn_t [protected]
 

reference week of current leap second

Definition at line 310 of file EngAlmanac.hpp.

Referenced by EngAlmanac::dump(), and EngAlmanac::EngAlmanac().


The documentation for this class was generated from the following files:
Generated on Tue May 21 03:31:49 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1