Synchronize Class Reference
[GPSTk data structures]

#include <Synchronize.hpp>

Inheritance diagram for Synchronize:

Inheritance graph
[legend]
Collaboration diagram for Synchronize:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class synchronizes two GNSS Data Structures data streams.

This class is meant to be used with the GNSS data structures objects found in "DataStructures" class.

A typical way to use this class follows:

      // INITIALIZATION PART

      // EBRE station nominal position
   Position nominalPos(4833520.192, 41537.1043, 4147461.560);
   RinexObsStream rin("ebre0300.02o");  // Data stream

      // Create the input observation file stream for REFERENCE STATION
   RinexObsStream rinRef("bell0300.02o");

      // GDS for rover data
   gnssRinex gRin;

      // GDS for reference station data
   gnssRinex gRef;

      // Create an object to synchronize rover and reference station
      // data streams. This object will take data out from "rinRef"
      // until it is synchronized with data in "gRin". Default
      // synchronization tolerance is 1 s, but we change it to 2.5 s.
   Synchronize synchro( rinRef,
                        gRin,
                        2.5 );

      // Create an object to compute the single differences of
      // prefit residuals
   DeltaOp delta;   // By default, it'll work on code prefit residuals


      // More declarations here....


     // PROCESSING PART

   while(rin >> gRin)
   {
         // First, let's synchronize and process reference station data
      try
      {

         gRef >> synchro >> myFilter >> modelRef;

         delta.setRefData(gRef.body);

      }
      catch(SynchronizeException& e)   // THIS IS VERY IMPORTANT IN
      {                                // ORDER TO MANAGE A POSSIBLE
         cout << endl;                 // DESYNCHRONIZATION!!!
         continue;
      }
      catch(...)
      {
         cerr << "Exception when processing reference station data "
              << "at epoch: " << gRef.header.epoch << endl;
      }


         // Rover data processing is done here:
      try
      {

         gRin >> myFilter >> model >> delta >> baseChange >> solverNEU;

      }
      catch(...)
      {
         cerr << "Exception at epoch: " << gRin10.header.epoch << endl;
      }

         // Print results
      cout << solverNEU.getSolution(TypeID::dLat) << "  ";
      cout << solverNEU.getSolution(TypeID::dLon) << "  ";
      cout << solverNEU.getSolution(TypeID::dH)   << "  ";
      cout << endl;
   }

Each Synchronize object will take data out of a RinexObsStream object holding reference data until the data stream is synchronized (within a given tolerance) with another data stream.

If synchronization is not possible at a given epoch, it will throw a "SynchronizeException" exception. The program then must handle it appropriately, usually just issuing a 'continue' statement in order to process next epoch.

See also:
Decimate.hpp for another time management class.

Definition at line 157 of file Synchronize.hpp.

Public Member Functions

 Synchronize ()
 Default constructor.
 Synchronize (RinexObsStream &rinexObs, gnssRinex &roverData, const double tol=1.0)
 Common constructor.
 Synchronize (RinexObsStream &rinexObs, gnssSatTypeValue &roverData, const double tol=1.0)
 Common constructor.
virtual gnssSatTypeValueProcess (gnssSatTypeValue &gData) throw (SynchronizeException)
 Returns a gnnsSatTypeValue object, adding the new data generated when calling this object.
virtual gnssRinexProcess (gnssRinex &gData) throw (SynchronizeException)
 Returns a gnnsRinex object, adding the new data generated when calling this object.
virtual double getTolerance (void) const
 Returns tolerance, in seconds.
virtual SynchronizesetTolerance (const double tol)
 Sets tolerance, in seconds.
virtual RinexObsStreamgetPtrReferenceSource (void) const
 Returns a pointer to the RinexObsStream object of reference data.
virtual SynchronizesetReferenceSource (RinexObsStream &rinexObs)
 Sets the RinexObsStream object of reference data.
virtual SynchronizesetRoverData (gnssRinex &roverData)
 Sets the gnssRinex that holds ROVER receiver data.
virtual SynchronizesetRoverData (gnssSatTypeValue &roverData)
 Sets the gnssSatTypeValue that holds ROVER receiver data.
virtual std::string getClassName (void) const
 Returns a string identifying this object.
virtual ~Synchronize ()
 Destructor.

Protected Member Functions

virtual gnssRinexProcess (CommonTime time, gnssRinex &gData) throw (SynchronizeException)

Protected Attributes

std::list< gnssRinexgnssRinexBuffer
 gnssRinex data buffer
RinexObsStreampRinexRef
 Pointer to input observation file stream for reference station.
gnssSatTypeValuepgRov1
 Pointer to gnnsRinex data structure (GDS) that holds ROVER data.
double tolerance
 Tolerance, in seconds.
bool firstTime
 Flag to mark that first data batch was read.


Constructor & Destructor Documentation

Synchronize  )  [inline]
 

Default constructor.

Definition at line 162 of file Synchronize.hpp.

Synchronize RinexObsStream rinexObs,
gnssRinex roverData,
const double  tol = 1.0
[inline]
 

Common constructor.

Parameters:
rinexObs RinexObsStream object of reference data.
roverData gnssRinex that holds ROVER receiver data
tol Tolerance, in seconds.

Definition at line 174 of file Synchronize.hpp.

Synchronize RinexObsStream rinexObs,
gnssSatTypeValue roverData,
const double  tol = 1.0
[inline]
 

Common constructor.

Parameters:
rinexObs RinexObsStream object of reference data.
roverData gnssSatTypeValue that holds ROVER receiver data
tol Tolerance, in seconds.

Definition at line 187 of file Synchronize.hpp.

virtual ~Synchronize  )  [inline, virtual]
 

Destructor.

Definition at line 258 of file Synchronize.hpp.


Member Function Documentation

std::string getClassName void   )  const [virtual]
 

Returns a string identifying this object.

Implements ProcessingClass.

Definition at line 38 of file Synchronize.cpp.

virtual RinexObsStream* getPtrReferenceSource void   )  const [inline, virtual]
 

Returns a pointer to the RinexObsStream object of reference data.

Definition at line 225 of file Synchronize.hpp.

virtual double getTolerance void   )  const [inline, virtual]
 

Returns tolerance, in seconds.

Definition at line 213 of file Synchronize.hpp.

gnssRinex & Process CommonTime  time,
gnssRinex gData
throw (SynchronizeException) [protected, virtual]
 

Definition at line 100 of file Synchronize.cpp.

References gpstk::abs(), and GPSTK_THROW.

gnssRinex & Process gnssRinex gData  )  throw (SynchronizeException) [virtual]
 

Returns a gnnsRinex object, adding the new data generated when calling this object.

Parameters:
gData Data object holding the data.

Implements ProcessingClass.

Definition at line 67 of file Synchronize.cpp.

gnssSatTypeValue & Process gnssSatTypeValue gData  )  throw (SynchronizeException) [virtual]
 

Returns a gnnsSatTypeValue object, adding the new data generated when calling this object.

Parameters:
gData Data object holding the data.

Implements ProcessingClass.

Definition at line 84 of file Synchronize.cpp.

References gnssData::body, and gnssRinex::header.

virtual Synchronize& setReferenceSource RinexObsStream rinexObs  )  [inline, virtual]
 

Sets the RinexObsStream object of reference data.

Parameters:
rinexObs RinexObsStream object of reference data.

Definition at line 233 of file Synchronize.hpp.

Referenced by NetworkObsStreams::addRinexObsFile().

virtual Synchronize& setRoverData gnssSatTypeValue roverData  )  [inline, virtual]
 

Sets the gnssSatTypeValue that holds ROVER receiver data.

Parameters:
roverData gnssSatTypeValue that holds ROVER receiver data

Definition at line 249 of file Synchronize.hpp.

virtual Synchronize& setRoverData gnssRinex roverData  )  [inline, virtual]
 

Sets the gnssRinex that holds ROVER receiver data.

Parameters:
roverData gnssRinex that holds ROVER receiver data

Definition at line 241 of file Synchronize.hpp.

Referenced by NetworkObsStreams::readEpochData().

Synchronize & setTolerance const double  tol  )  [virtual]
 

Sets tolerance, in seconds.

Parameters:
tol Tolerance, in seconds.

Definition at line 47 of file Synchronize.cpp.

References Synchronize::tolerance.


Member Data Documentation

bool firstTime [protected]
 

Flag to mark that first data batch was read.

Definition at line 282 of file Synchronize.hpp.

std::list<gnssRinex> gnssRinexBuffer [protected]
 

gnssRinex data buffer

Definition at line 267 of file Synchronize.hpp.

gnssSatTypeValue* pgRov1 [protected]
 

Pointer to gnnsRinex data structure (GDS) that holds ROVER data.

Definition at line 275 of file Synchronize.hpp.

RinexObsStream* pRinexRef [protected]
 

Pointer to input observation file stream for reference station.

Definition at line 271 of file Synchronize.hpp.

double tolerance [protected]
 

Tolerance, in seconds.

Definition at line 279 of file Synchronize.hpp.

Referenced by Synchronize::setTolerance().


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