Public Member Functions | Private Member Functions | Private Attributes | List of all members
gnsstk::SatPassIterator Class Reference

Detailed Description

Iterate over a list (vector) of SatPass using this class. NB. this class ignores passes that have Status less than zero, but does not change any Status.

Definition at line 55 of file SatPassIterator.hpp.

#include <SatPassIterator.hpp>

Public Member Functions

double getDT ()
 Get the time interval, which is common to all the SatPass in the list. More...
 
Epoch getFirstGoodTime () const
 
Epoch getFirstTime ()
 Get the first (earliest) time found in the SatPass list. More...
 
std::map< unsigned int, unsigned int > getIndexes ()
 
Epoch getLastGoodTime () const
 
Epoch getLastTime ()
 Get the last (latest) time found in the SatPass list. More...
 
int next (RinexObsData &robs)
 
int next (std::map< unsigned int, unsigned int > &indexMap)
 
void reset (bool rev=false, bool dbug=false)
 Restart the iteration, i.e. return to the initial time. More...
 
 SatPassIterator (std::vector< SatPass > &splist, bool rev=false, bool dbug=false)
 

Private Member Functions

SatPassIteratoroperator= (const SatPassIterator &)
 
 SatPassIterator (const SatPassIterator &)
 

Private Attributes

std::map< RinexSatID, int > countOffset
 offset in count of the current object in the list for this satellite More...
 
int currentN
 count of the current epoch, = 0,1,... More...
 
std::map< RinexSatID, int > dataIndex
 
bool debug
 if true, print debug info in nex() More...
 
double DT
 
Epoch FirstTime
 
std::vector< int > indexStatus
 
Epoch LastTime
 
std::map< RinexSatID, int > listIndex
 index of the current object in the list for this satellite More...
 
std::map< unsigned int, unsigned int > nextIndexMap
 
std::vector< SatPass > & SPList
 reference to the vector of passes being processed More...
 
bool timeReverse
 if true, iterate in reverse time order More...
 

Constructor & Destructor Documentation

◆ SatPassIterator() [1/2]

gnsstk::SatPassIterator::SatPassIterator ( std::vector< SatPass > &  splist,
bool  rev = false,
bool  dbug = false 
)
explicit

Explicit (only) constructor. Check the list for consistency (else throw) and find common time step and obs types, as well as first and last times. Ignore passes with Status less than zero. After building a vector<SatPass> (in time order), declare an iterator using this constructor, then call member function next(RinexObsData&) to access the data in time order, until it returns zero.

Parameters
splistVector of (consistent) SatPass objects
revIf true, interate in reverse time order
dbugIf true, print debug info in next()
Returns
1 for success, 0 at the end of the dataset.
Exceptions
Exceptionif input list is empty, or if elements in the list have differing data interval or obs types, or if any observation type is not registered (cf. RinexUtilities.hpp)

Definition at line 52 of file SatPassIterator.cpp.

◆ SatPassIterator() [2/2]

gnsstk::SatPassIterator::SatPassIterator ( const SatPassIterator )
private

Member Function Documentation

◆ getDT()

double gnsstk::SatPassIterator::getDT ( )
inline

Get the time interval, which is common to all the SatPass in the list.

Definition at line 136 of file SatPassIterator.hpp.

◆ getFirstGoodTime()

Epoch gnsstk::SatPassIterator::getFirstGoodTime ( ) const
inline
Returns
the earliest time of good data in this SatPass list

Definition at line 112 of file SatPassIterator.hpp.

◆ getFirstTime()

Epoch gnsstk::SatPassIterator::getFirstTime ( )
inline

Get the first (earliest) time found in the SatPass list.

Definition at line 106 of file SatPassIterator.hpp.

◆ getIndexes()

std::map<unsigned int, unsigned int> gnsstk::SatPassIterator::getIndexes ( )
inline

get a map of pairs of indexes for the current epoch. call this after calling next() to get pairs (i,j) where the data returned by next() is the same as SatPassList[i].data(j,<obstype>), for each i in the map, and j=map[i].

Definition at line 144 of file SatPassIterator.hpp.

◆ getLastGoodTime()

Epoch gnsstk::SatPassIterator::getLastGoodTime ( ) const
inline
Returns
the latest time of good data in this SatPass list

Definition at line 124 of file SatPassIterator.hpp.

◆ getLastTime()

Epoch gnsstk::SatPassIterator::getLastTime ( )
inline

Get the last (latest) time found in the SatPass list.

Definition at line 109 of file SatPassIterator.hpp.

◆ next() [1/2]

int gnsstk::SatPassIterator::next ( RinexObsData robs)

Access (all of) the data for the next epoch. As long as this function returns non-zero, there is more data to be accessed. Ignore passes with Status less than zero. NB. If SatPass obs types are not registered (cf. RinexUtilities.hpp), then data will NOT be added to RinexObsData. NB. This assumes that all the SatPasses have the same obs in the same order!!

Parameters
robsRinexObsData in which data is returned.
Returns
1 for success, 0 at the end of the dataset.
Exceptions
Exceptionif time tags are out of order

Definition at line 396 of file SatPassIterator.cpp.

◆ next() [2/2]

int gnsstk::SatPassIterator::next ( std::map< unsigned int, unsigned int > &  indexMap)

Access (all of) the data for the next epoch. As long as this function returns non-zero, there is more data to be accessed. Ignore passes with Status less than zero.

Parameters
indexMapmap<unsigned int, unsigned int> defined so that all the data in the current iteration is found at SatPassList[i].data(j) where indexMap[i] = j.
Returns
1 for success, 0 at the end of the dataset.
Exceptions
Exceptionif time tags are out of order.

Definition at line 190 of file SatPassIterator.cpp.

◆ operator=()

SatPassIterator& gnsstk::SatPassIterator::operator= ( const SatPassIterator )
private

◆ reset()

void gnsstk::SatPassIterator::reset ( bool  rev = false,
bool  dbug = false 
)

Restart the iteration, i.e. return to the initial time.

Definition at line 114 of file SatPassIterator.cpp.

Member Data Documentation

◆ countOffset

std::map<RinexSatID, int> gnsstk::SatPassIterator::countOffset
private

offset in count of the current object in the list for this satellite

Definition at line 185 of file SatPassIterator.hpp.

◆ currentN

int gnsstk::SatPassIterator::currentN
private

count of the current epoch, = 0,1,...

Definition at line 160 of file SatPassIterator.hpp.

◆ dataIndex

std::map<RinexSatID, int> gnsstk::SatPassIterator::dataIndex
private

index of the data vector (spdvector) of the current object in the list for this satellite

Definition at line 182 of file SatPassIterator.hpp.

◆ debug

bool gnsstk::SatPassIterator::debug
private

if true, print debug info in nex()

Definition at line 154 of file SatPassIterator.hpp.

◆ DT

double gnsstk::SatPassIterator::DT
private

time step (seconds) found in all objects in the list (constructor throws if they are not identical).

Definition at line 166 of file SatPassIterator.hpp.

◆ FirstTime

Epoch gnsstk::SatPassIterator::FirstTime
private

first (earliest) start time (getFirstGoodTime()) of the passes in the list, and last (latest) end time (getLastGoodTime()) of the passes in the list.

Definition at line 173 of file SatPassIterator.hpp.

◆ indexStatus

std::vector<int> gnsstk::SatPassIterator::indexStatus
private

vector parallel to SPList used to mark current use by iteration; value is "-1,0,1" as SPList[i] is "yet to be used, in use, done". This has nothing to do with SatPass::Status()

Definition at line 192 of file SatPassIterator.hpp.

◆ LastTime

Epoch gnsstk::SatPassIterator::LastTime
private

Definition at line 173 of file SatPassIterator.hpp.

◆ listIndex

std::map<RinexSatID, int> gnsstk::SatPassIterator::listIndex
private

index of the current object in the list for this satellite

Definition at line 176 of file SatPassIterator.hpp.

◆ nextIndexMap

std::map<unsigned int, unsigned int> gnsstk::SatPassIterator::nextIndexMap
private

map of indexes i,j, created by next(), such that data returned by next() is found at SatPassList[i].spdvector[j] where map[i]=j.

Definition at line 201 of file SatPassIterator.hpp.

◆ SPList

std::vector<SatPass>& gnsstk::SatPassIterator::SPList
private

reference to the vector of passes being processed

Definition at line 195 of file SatPassIterator.hpp.

◆ timeReverse

bool gnsstk::SatPassIterator::timeReverse
private

if true, iterate in reverse time order

Definition at line 157 of file SatPassIterator.hpp.


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


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