TabularSatStore Class Template Reference
[Ephemstore]

#include <TabularSatStore.hpp>

Inheritance diagram for TabularSatStore:

Inheritance graph
[legend]
Collaboration diagram for TabularSatStore:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class DataRecord>
class gpstk::TabularSatStore< DataRecord >

Store a table of data vs time for each of several satellites.

The data are stored as DataRecords, one for each satellite,time. The getValue(sat, t) routine interpolates the table for sat at time t and returns the result as a DataRecord object. NB this is an abstract class b/c getValue() and others are pure virtual. NB this class (dump()) requires that operator<<(DataRecord) be defined.

Definition at line 34 of file TabularSatStore.hpp.

Public Member Functions

 TabularSatStore () throw ()
 Default constructor.
virtual ~TabularSatStore ()
 Destructor.
virtual DataRecord getValue (const SatID &sat, const CommonTime &ttag) const =0 throw (InvalidRequest)
 Return data value for the given satellite at the given time (usually via interpolation of the data table).
virtual bool getTableInterval_old (const SatID &sat, const CommonTime &ttag, const int &nhalf, typename DataTable::const_iterator &it1, typename DataTable::const_iterator &it2, bool exactReturn=true) const throw (InvalidRequest)
 Locate the given time in the DataTable for the given satellite.
virtual bool getTableInterval (const SatID &sat, const CommonTime &ttag, const int &nhalf, typename DataTable::const_iterator &it1, typename DataTable::const_iterator &it2, bool exactReturn=true) const throw (InvalidRequest)
 Locate the given time in the DataTable for the given satellite.
virtual void dump (std::ostream &os=std::cout, int detail=0) const throw ()
 Dump information about the object to an ostream.
void edit (const CommonTime &tmin, const CommonTime &tmax=CommonTime::END_OF_TIME) throw ()
 Edit the data tables, removing data outside the indicated time interval.
void clear () throw ()
 Remove all data and reset time limits.
virtual bool isPresent (const SatID &sat) const throw ()
 Return true if the given SatID is present in the store.
void checkTimeSystem (const TimeSystem &ts) const throw (InvalidRequest)
 determine if the input TimeSystem conflicts with the stored TimeSystem
CommonTime getInitialTime () const throw (InvalidRequest)
 Get the earliest time of data in the data tables.
CommonTime getFinalTime () const throw (InvalidRequest)
 Get the latest time of data in the data tables.
CommonTime getInitialTime (const SatID &sat) const throw (InvalidRequest)
 Get the earliest time of data in the store for the given satellite.
CommonTime getFinalTime (const SatID &sat) const throw (InvalidRequest)
 Get the latest time of data in the store for the given satellite.
void dumpInterval (typename DataTable::const_iterator &it1, typename DataTable::const_iterator &it2, std::ostream &os=std::cout) const throw ()
 Dump the data in a subset of the tables as defined by iterators.
bool hasPosition () const throw ()
 Does this store contain position, etc data stored in the tables?
bool hasVelocity () const throw ()
bool hasClockBias () const throw ()
bool hasClockDrift () const throw ()
int nsats (void) const throw ()
 Get number of satellites available.
bool hasSatellite (const SatID &sat) const throw ()
 Is the given satellite present?
std::vector< SatIDgetSatList (void) const throw ()
 Get a list (std::vector) of SatIDs present in the store.
int ndata (void) const throw ()
 Get the total number of data records in the store.
int ndata (const SatID &sat) const throw ()
 Get the number of data records for the given sat.
int size (void) const throw ()
 same as ndata()
double nomTimeStep (const SatID &sat) const throw ()
 compute the nominal timestep of the data table for the given satellite
bool isDataGapCheck (void) throw ()
 Is gap checking on?
void disableDataGapCheck (void) throw ()
 Disable checking of data gaps.
double getGapInterval (void) throw ()
 Get current gap interval.
void setGapInterval (double interval) throw ()
 Set gap interval and turn on gap checking.
bool isIntervalCheck (void) throw ()
 Is interval checking on?
void disableIntervalCheck (void) throw ()
 Disable checking of maximum interval.
double getMaxInterval (void) throw ()
 Get current maximum interval.
void setMaxInterval (double interval) throw ()
 Set maximum interval and turn on interval checking.
TimeSystem getTimeSystem (void) throw ()
 get the store's time system
void setTimeSystem (const TimeSystem &ts) throw ()
 set the store's time system
bool getSmartMode ()
 get the smartMode flag to select data from the table for interpolation
void setSmartMode (bool smart=true)
 set the smartMode flag to select data from the table for interpolation

Protected Types

typedef std::map< CommonTime,
DataRecord > 
DataTable
 std::map with key=CommonTime, value=DataRecord
typedef std::map< SatID, DataTableSatTable
 std::map with key=SatID, value=DataTable
typedef DataTable::const_iterator DataTableIterator

Protected Attributes

SatTable tables
 the data tables: std::map<SatID, std::map<CommonTime, DataRecord> >
TimeSystem storeTimeSystem
 Time system of tables; default and initial value is TimeSystem::Any.
bool havePosition
 Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.
bool haveVelocity
 Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.
bool haveClockBias
 Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.
bool haveClockDrift
 Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.
bool checkDataGap
 Flag to check for data gaps (default false).
double gapInterval
 Smallest time interval (seconds) that constitutes a data gap.
bool checkInterval
 Flag to check the length of available interpolation interval (default false) If this flag is enabled, interpolation intervals shorter than member data maxInterval will throw an InvalidRequest exception in getValue() methods.
double maxInterval
 Maximum total time interval (seconds) allowed for interpolation.
bool smartMode
 Flag to allow pick more epochs if one side without enough data(default false) Enable this option, we can process daily data with loading a single sp3 file but not three, that will save both memory and loading time especially when we use 5 seconds clock data from CODE.


Member Typedef Documentation

typedef std::map<CommonTime, DataRecord> DataTable [protected]
 

std::map with key=CommonTime, value=DataRecord

Definition at line 42 of file TabularSatStore.hpp.

typedef DataTable::const_iterator DataTableIterator [protected]
 

Definition at line 85 of file TabularSatStore.hpp.

typedef std::map<SatID, DataTable> SatTable [protected]
 

std::map with key=SatID, value=DataTable

Definition at line 45 of file TabularSatStore.hpp.


Constructor & Destructor Documentation

TabularSatStore  )  throw () [inline]
 

Default constructor.

Definition at line 91 of file TabularSatStore.hpp.

virtual ~TabularSatStore  )  [inline, virtual]
 

Destructor.

Definition at line 100 of file TabularSatStore.hpp.


Member Function Documentation

void checkTimeSystem const TimeSystem ts  )  const throw (InvalidRequest) [inline]
 

determine if the input TimeSystem conflicts with the stored TimeSystem

Parameters:
ts TimeSystem to compare with stored TimeSystem
Exceptions:
if time systems are inconsistent

Definition at line 504 of file TabularSatStore.hpp.

void clear void   )  throw () [inline]
 

Remove all data and reset time limits.

Definition at line 494 of file TabularSatStore.hpp.

void disableDataGapCheck void   )  throw () [inline]
 

Disable checking of data gaps.

Definition at line 712 of file TabularSatStore.hpp.

void disableIntervalCheck void   )  throw () [inline]
 

Disable checking of maximum interval.

Definition at line 725 of file TabularSatStore.hpp.

virtual void dump std::ostream &  os = std::cout,
int  detail = 0
const throw () [inline, virtual]
 

Dump information about the object to an ostream.

Parameters:
[in] os ostream to receive the output; defaults to std::cout
[in] detail integer level of detail to provide; allowed values are 0: number of satellites, time step and time limits, flags, and gap and interval flags and values 1: number of data/sat 2: above plus all the data tables

Reimplemented in ClockSatStore, PositionSatStore, and RinexClockStore.

Definition at line 414 of file TabularSatStore.hpp.

void dumpInterval typename DataTable::const_iterator &  it1,
typename DataTable::const_iterator &  it2,
std::ostream &  os = std::cout
const throw () [inline]
 

Dump the data in a subset of the tables as defined by iterators.

Note that the interval includes both it1 and it2.

Definition at line 611 of file TabularSatStore.hpp.

void edit const CommonTime tmin,
const CommonTime tmax = CommonTime::END_OF_TIME
throw () [inline]
 

Edit the data tables, removing data outside the indicated time interval.

Parameters:
[in] tmin defines the beginning of the time interval
[in] tmax defines the end of the time interval

Definition at line 469 of file TabularSatStore.hpp.

CommonTime getFinalTime const SatID sat  )  const throw (InvalidRequest) [inline]
 

Get the latest time of data in the store for the given satellite.

Returns:
the last time.
Exceptions:
InvalidRequest if there is no data in the store for this satellite.

Definition at line 592 of file TabularSatStore.hpp.

CommonTime getFinalTime  )  const throw (InvalidRequest) [inline]
 

Get the latest time of data in the data tables.

Returns:
the latest time
Exceptions:
InvalidRequest if the store is empty.

Definition at line 545 of file TabularSatStore.hpp.

Referenced by SP3EphemerisStore::getFinalTime().

double getGapInterval void   )  throw () [inline]
 

Get current gap interval.

Definition at line 715 of file TabularSatStore.hpp.

CommonTime getInitialTime const SatID sat  )  const throw (InvalidRequest) [inline]
 

Get the earliest time of data in the store for the given satellite.

Returns:
the first time.
Exceptions:
InvalidRequest if there is no data in the store for this satellite.

Definition at line 574 of file TabularSatStore.hpp.

CommonTime getInitialTime  )  const throw (InvalidRequest) [inline]
 

Get the earliest time of data in the data tables.

Returns:
the earliest time
Exceptions:
InvalidRequest if the store is empty.

Definition at line 518 of file TabularSatStore.hpp.

Referenced by SP3EphemerisStore::getInitialTime().

double getMaxInterval void   )  throw () [inline]
 

Get current maximum interval.

Definition at line 728 of file TabularSatStore.hpp.

std::vector<SatID> getSatList void   )  const throw () [inline]
 

Get a list (std::vector) of SatIDs present in the store.

Definition at line 639 of file TabularSatStore.hpp.

bool getSmartMode  )  [inline]
 

get the smartMode flag to select data from the table for interpolation

Definition at line 743 of file TabularSatStore.hpp.

virtual bool getTableInterval const SatID sat,
const CommonTime ttag,
const int &  nhalf,
typename DataTable::const_iterator &  it1,
typename DataTable::const_iterator &  it2,
bool  exactReturn = true
const throw (InvalidRequest) [inline, virtual]
 

Locate the given time in the DataTable for the given satellite.

Return two const iterators it1 and it2 (it1 < it2) giving the range of 2*nhalf points. Note that a range is returned even if the input time exactly matches one of the times in the table; in this 'exact match' case the matching time will be at either it1->first (if input parameter exactReturn is true) or (it1+nhalf-1) or (it1+nhalf) (if exactReturn is false). This routine is used to select data from the table for interpolation; note that DataTable is a map<CommonTime, DataRecord>.

Parameters:
[in] sat satellite of interest
[in] ttag time of interest, e.g. where interpolation will be conducted
[in] nhalf number of table points desired on each side of ttag
it1 const reference to const_iterator, points to the interval begin
it2 const reference to const_iterator, points to the interval end
[in] exactReturn if true and exact match is found, return immediately, with the matching time at it1 (== it1->first) [default is true].
Returns:
bool: true if ttag matches a time in the table and exactReturn was true, then the matching time is at it1 (it2 is undefined); if exactReturn was false, then the range (it1,it2) is valid and the matching time is at either (it1+nhalf-1) or (it1+nhalf).
Exceptions:
the satellite is not found in the tables, or there is inadequate data
GapInterval is set and there is a data gap larger than the max
MaxInterval is set and the interval is too wide

Definition at line 274 of file TabularSatStore.hpp.

virtual bool getTableInterval_old const SatID sat,
const CommonTime ttag,
const int &  nhalf,
typename DataTable::const_iterator &  it1,
typename DataTable::const_iterator &  it2,
bool  exactReturn = true
const throw (InvalidRequest) [inline, virtual]
 

Locate the given time in the DataTable for the given satellite.

Return two const iterators it1 and it2 (it1 < it2) giving the range of 2*nhalf points, nhalf on each side of the given time. Note that a range is returned even if the input time exactly matches one of the times in the table; in this 'exact match' case the matching time will be at either it1->first (if input parameter exactReturn is true) or (it1+nhalf-1) or (it1+nhalf) (if exactReturn is false). This routine is used to select data from the table for interpolation; note that DataTable is a map<CommonTime, DataRecord>.

Parameters:
[in] sat satellite of interest
[in] ttag time of interest, e.g. where interpolation will be conducted
[in] nhalf number of table points desired on each side of ttag
it1 const reference to const_iterator, points to the interval begin
it2 const reference to const_iterator, points to the interval end
[in] exactReturn if true and exact match is found, return immediately, with the matching time at it1 (== it1->first) [default is true].
Returns:
bool: true if ttag matches a time in the table and exactReturn was true, then the matching time is at it1 (it2 is undefined); if exactReturn was false, then the range (it1,it2) is valid and the matching time is at either (it1+nhalf-1) or (it1+nhalf).
Exceptions:
the satellite is not found in the tables, or there is inadequate data
GapInterval is set and there is a data gap larger than the max
MaxInterval is set and the interval is too wide

Definition at line 148 of file TabularSatStore.hpp.

TimeSystem getTimeSystem void   )  throw () [inline]
 

get the store's time system

Definition at line 737 of file TabularSatStore.hpp.

virtual DataRecord getValue const SatID sat,
const CommonTime ttag
const throw (InvalidRequest) [pure virtual]
 

Return data value for the given satellite at the given time (usually via interpolation of the data table).

Parameters:
[in] sat the SatID of the satellite of interest
[in] ttag the time (CommonTime) of interest
Returns:
object of type DataRecord containing the data value(s).
Exceptions:
InvalidRequest if data value cannot be computed, for example because a) the time t does not lie within the time limits of the data table b) checkDataGap is true and there is a data gap c) checkInterval is true and the interval is larger than maxInterval NB this function is pure virtual, making the class abstract.
Derived objects can implement similar routines, for example: Triple getPosition(const SatID& sat,const CommonTime& t) throw(InvalidRequest); Triple getVelocity(const SatID& sat,const CommonTime& t) throw(InvalidRequest); Triple getAccel(const SatID& sat,const CommonTime& t) throw(InvalidRequest); double getClockBias(const SatID& s,const CommonTime& t) throw(InvalidRequest); double[2] getClock(const SatID& sat,const CommonTime& t) throw(InvalidRequest); NB Xvt getXvt(const SatID& sat,const CommonTime& t) throw(InvalidRequest); will be provided by another class which inherits this one.

Implemented in ClockSatStore, and PositionSatStore.

bool hasClockBias  )  const throw () [inline]
 

Definition at line 628 of file TabularSatStore.hpp.

bool hasClockDrift  )  const throw () [inline]
 

Definition at line 629 of file TabularSatStore.hpp.

bool hasPosition  )  const throw () [inline]
 

Does this store contain position, etc data stored in the tables?

Definition at line 626 of file TabularSatStore.hpp.

bool hasSatellite const SatID sat  )  const throw () [inline]
 

Is the given satellite present?

Definition at line 635 of file TabularSatStore.hpp.

bool hasVelocity  )  const throw () [inline]
 

Definition at line 627 of file TabularSatStore.hpp.

bool isDataGapCheck void   )  throw () [inline]
 

Is gap checking on?

Definition at line 709 of file TabularSatStore.hpp.

bool isIntervalCheck void   )  throw () [inline]
 

Is interval checking on?

Definition at line 722 of file TabularSatStore.hpp.

virtual bool isPresent const SatID sat  )  const throw () [inline, virtual]
 

Return true if the given SatID is present in the store.

Definition at line 498 of file TabularSatStore.hpp.

int ndata const SatID sat  )  const throw () [inline]
 

Get the number of data records for the given sat.

Definition at line 659 of file TabularSatStore.hpp.

int ndata void   )  const throw () [inline]
 

Get the total number of data records in the store.

Definition at line 649 of file TabularSatStore.hpp.

double nomTimeStep const SatID sat  )  const throw () [inline]
 

compute the nominal timestep of the data table for the given satellite

Returns:
0 if satellite is not found, else the nominal timestep in seconds.

Definition at line 671 of file TabularSatStore.hpp.

int nsats void   )  const throw () [inline]
 

Get number of satellites available.

Definition at line 632 of file TabularSatStore.hpp.

void setGapInterval double  interval  )  throw () [inline]
 

Set gap interval and turn on gap checking.

Definition at line 718 of file TabularSatStore.hpp.

void setMaxInterval double  interval  )  throw () [inline]
 

Set maximum interval and turn on interval checking.

Definition at line 731 of file TabularSatStore.hpp.

void setSmartMode bool  smart = true  )  [inline]
 

set the smartMode flag to select data from the table for interpolation

Definition at line 746 of file TabularSatStore.hpp.

void setTimeSystem const TimeSystem ts  )  throw () [inline]
 

set the store's time system

Definition at line 740 of file TabularSatStore.hpp.

int size void   )  const throw () [inline]
 

same as ndata()

Definition at line 667 of file TabularSatStore.hpp.


Member Data Documentation

bool checkDataGap [protected]
 

Flag to check for data gaps (default false).

If this flag is enabled, data gaps wider than member data gapInterval will throw an InvalidRequest exception in getValue() methods.

Definition at line 64 of file TabularSatStore.hpp.

bool checkInterval [protected]
 

Flag to check the length of available interpolation interval (default false) If this flag is enabled, interpolation intervals shorter than member data maxInterval will throw an InvalidRequest exception in getValue() methods.

Definition at line 72 of file TabularSatStore.hpp.

double gapInterval [protected]
 

Smallest time interval (seconds) that constitutes a data gap.

Definition at line 67 of file TabularSatStore.hpp.

bool haveClockBias [protected]
 

Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.

Defaults are false, but deriving class should define in c'tor.

Definition at line 59 of file TabularSatStore.hpp.

bool haveClockDrift [protected]
 

Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.

Defaults are false, but deriving class should define in c'tor.

Definition at line 59 of file TabularSatStore.hpp.

bool havePosition [protected]
 

Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.

Defaults are false, but deriving class should define in c'tor.

Definition at line 59 of file TabularSatStore.hpp.

bool haveVelocity [protected]
 

Flags indicating that various data are present and may be accessed with getValue(t) or other routines, via interpolation of the data tables.

Defaults are false, but deriving class should define in c'tor.

Definition at line 59 of file TabularSatStore.hpp.

double maxInterval [protected]
 

Maximum total time interval (seconds) allowed for interpolation.

For example, with dt=900s and 10-point Lagrange interpolation, this should be (10-1)*900s+1= 8101s.

Definition at line 77 of file TabularSatStore.hpp.

bool smartMode [protected]
 

Flag to allow pick more epochs if one side without enough data(default false) Enable this option, we can process daily data with loading a single sp3 file but not three, that will save both memory and loading time especially when we use 5 seconds clock data from CODE.

Definition at line 83 of file TabularSatStore.hpp.

TimeSystem storeTimeSystem [protected]
 

Time system of tables; default and initial value is TimeSystem::Any.

Set and maintained by derived classes, using set and checkTimeSystem(); Any call to add records with a specific system sets it; then other add.. or get.. calls will throw if the time systems do not match.

Definition at line 54 of file TabularSatStore.hpp.

SatTable tables [protected]
 

the data tables: std::map<SatID, std::map<CommonTime, DataRecord> >

Definition at line 48 of file TabularSatStore.hpp.


The documentation for this class was generated from the following file:
Generated on Sun May 19 03:31:54 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1