Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gnsstk::SatDataReader Class Reference

Detailed Description

This is a class to read and parse satellite data from PRN_GPS-like files.

Jet Propulsion Laboratory (JPL) provides a file called "PRN_GPS" with satellite information such as launch and deactivation dates, block type GPS number, etc. This information is important for some precise GPS data processing algorithms, and is used in Gipsy/OASIS software.

You may find this file using FTP:

ftp://sideshow.jpl.nasa.gov:/pub/gipsy_products/gipsy_params

where the PRN_GPS file resides, usually compressed in .gz format.

A typical way to use this class follows:

SatDataReader satread;
SatID prn28(28, SatelliteSystem::GPS);
CommonTime time(1995, 331, 43200);
satread.open("PRN_GPS");
string prn28Block = satread.getBlock(prn28, time);
// From 1992 to 1997, PRN 28 belonged to a block IIA satellite
Warning
Be aware that PRN numbers are recycled, so several different satellites may have the same PRN number at different epochs. Therefore, you must provide the epoch of interest when calling get methods.

Definition at line 95 of file SatDataReader.hpp.

#include <SatDataReader.hpp>

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

Classes

struct  svData
 A structure used to store satellite data. More...
 

Public Member Functions

virtual SatDataReaderclearData ()
 Method to clear all previously loaded satellite data. More...
 
virtual std::string getBlock (const SatID &sat, const CommonTime &epoch) const
 
virtual CommonTime getDeactivationDate (const SatID &sat, const CommonTime &epoch) const
 
virtual int getGPSNumber (const SatID &sat, const CommonTime &epoch) const
 
virtual CommonTime getLaunchDate (const SatID &sat, const CommonTime &epoch) const
 
virtual void open (const char *fn)
 Method to open AND load satellite data file. More...
 
virtual void open (const std::string &fn)
 Method to open AND load satellite data file. More...
 
 SatDataReader ()
 Default constructor. More...
 
 SatDataReader (const char *fn)
 
 SatDataReader (const std::string &fn)
 
virtual ~SatDataReader ()
 Destructor. More...
 
- Public Member Functions inherited from gnsstk::FFTextStream
 FFTextStream ()
 Default constructor. More...
 
 FFTextStream (const char *fn, std::ios::openmode mode=std::ios::in)
 
 FFTextStream (const std::string &fn, std::ios::openmode mode=std::ios::in)
 
void formattedGetLine (std::string &line, const bool expectEOF=false)
 
virtual void open (const char *fn, std::ios::openmode mode)
 Overrides open to reset the line number. More...
 
virtual void open (const std::string &fn, std::ios::openmode mode)
 Overrides open to reset the line number. More...
 
virtual ~FFTextStream ()
 Destructor. More...
 
- Public Member Functions inherited from gnsstk::FFStream
void conditionalThrow (void)
 
void dumpState (std::ostream &s=std::cout) const
 A function to help debug FFStreams. More...
 
 FFStream ()
 Default constructor, initialize internal data. More...
 
 FFStream (const char *fn, std::ios::openmode mode=std::ios::in)
 
 FFStream (const std::string &fn, std::ios::openmode mode=std::ios::in)
 
virtual ~FFStream ()
 Virtual destructor, close the stream etc. More...
 

Private Types

typedef std::multimap< SatID, svData >::const_iterator satDataIt
 Handy iterator type. More...
 

Private Member Functions

virtual void loadData (void)
 
void setData (const SatID &sat, const svData &data)
 

Private Attributes

std::multimap< SatID, svDataSatelliteData
 Map holding the information regarding every satellite. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from gnsstk::FFStream
static bool isFFStream (std::istream &i)
 Check if the input stream is the kind of RinexObsStream. More...
 
- Public Attributes inherited from gnsstk::FFTextStream
unsigned int lineNumber
 
- Public Attributes inherited from gnsstk::FFStream
std::string filename
 file name More...
 
FFStreamError mostRecentException
 This stores the most recently thrown exception. More...
 
unsigned int recordNumber
 keeps track of the number of records read More...
 
- Protected Member Functions inherited from gnsstk::FFTextStream
virtual void tryFFStreamGet (FFData &rec)
 
virtual void tryFFStreamPut (const FFData &rec)
 

Member Typedef Documentation

◆ satDataIt

typedef std::multimap<SatID, svData>::const_iterator gnsstk::SatDataReader::satDataIt
private

Handy iterator type.

Definition at line 214 of file SatDataReader.hpp.

Constructor & Destructor Documentation

◆ SatDataReader() [1/3]

gnsstk::SatDataReader::SatDataReader ( )
inline

Default constructor.

Definition at line 100 of file SatDataReader.hpp.

◆ SatDataReader() [2/3]

gnsstk::SatDataReader::SatDataReader ( const char *  fn)
inline

Common constructor. It will always open file for read and will load satellite data in one pass.

Parameters
fnSatellite data file to read

Definition at line 108 of file SatDataReader.hpp.

◆ SatDataReader() [3/3]

gnsstk::SatDataReader::SatDataReader ( const std::string &  fn)
inline

Common constructor. It will always open file for read and will load satellite data in one pass.

Parameters
fnSatellite data file to read

Definition at line 118 of file SatDataReader.hpp.

◆ ~SatDataReader()

virtual gnsstk::SatDataReader::~SatDataReader ( )
inlinevirtual

Destructor.

Definition at line 191 of file SatDataReader.hpp.

Member Function Documentation

◆ clearData()

virtual SatDataReader& gnsstk::SatDataReader::clearData ( )
inlinevirtual

Method to clear all previously loaded satellite data.

Definition at line 132 of file SatDataReader.hpp.

◆ getBlock()

string gnsstk::SatDataReader::getBlock ( const SatID sat,
const CommonTime epoch 
) const
virtual

Method to get the block type of a given SV at a given epoch.

Parameters
satSatellite ID.
epochEpoch of interest.
Returns
String containing satellite's block. If satellite is not found or epoch is out of proper launch/deactivation bounds, this method will return an empty string.

Definition at line 223 of file SatDataReader.cpp.

◆ getDeactivationDate()

CommonTime gnsstk::SatDataReader::getDeactivationDate ( const SatID sat,
const CommonTime epoch 
) const
virtual

Method to get the deactivation date of a given SV.

Parameters
satSatellite ID.
epochEpoch of interest.
Returns
CommonTime object containing satellite's deactivation date. If satellite is not found, epoch is out of proper launch/deactivation bounds or satellite is still active, this method will return CommonTime::BEGINNING_OF_TIME.

Definition at line 373 of file SatDataReader.cpp.

◆ getGPSNumber()

int gnsstk::SatDataReader::getGPSNumber ( const SatID sat,
const CommonTime epoch 
) const
virtual

Method to get the GPS number of a given SV at a given epoch.

Parameters
satSatellite ID.
epochEpoch of interest.
Returns
Integer containing satellite's block. If satellite is not found or epoch is out of proper launch/deactivation bounds, this method will return -1.

Definition at line 273 of file SatDataReader.cpp.

◆ getLaunchDate()

CommonTime gnsstk::SatDataReader::getLaunchDate ( const SatID sat,
const CommonTime epoch 
) const
virtual

Method to get the launch date of a given SV.

Parameters
satSatellite ID.
epochEpoch of interest.
Returns
CommonTime object containing satellite's launch date. If satellite is not found or epoch is out of proper launch/deactivation bounds, this method will return CommonTime::END_OF_TIME.

Definition at line 323 of file SatDataReader.cpp.

◆ loadData()

void gnsstk::SatDataReader::loadData ( void  )
privatevirtual

Method to load satellite data in this class' data map

Exceptions
FFStreamError
StringUtils::StringException

Definition at line 53 of file SatDataReader.cpp.

◆ open() [1/2]

void gnsstk::SatDataReader::open ( const char *  fn)
virtual

Method to open AND load satellite data file.

Definition at line 178 of file SatDataReader.cpp.

◆ open() [2/2]

void gnsstk::SatDataReader::open ( const std::string &  fn)
virtual

Method to open AND load satellite data file.

Definition at line 196 of file SatDataReader.cpp.

◆ setData()

void gnsstk::SatDataReader::setData ( const SatID sat,
const svData data 
)
inlineprivate

Method to store satellite data in this class' data map

Parameters
satSatellite ID.
datasvData structure holding the SV data

Definition at line 225 of file SatDataReader.hpp.

Member Data Documentation

◆ SatelliteData

std::multimap<SatID, svData> gnsstk::SatDataReader::SatelliteData
private

Map holding the information regarding every satellite.

Definition at line 218 of file SatDataReader.hpp.


The documentation for this class was generated from the following files:
gnsstk::SatelliteSystem::GPS
@ GPS
example4.time
time
Definition: example4.py:103
gnsstk::SatDataReader::SatDataReader
SatDataReader()
Default constructor.
Definition: SatDataReader.hpp:100


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