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

Detailed Description

Class to determine fundamental information about a RINEX obs file, from both the header and by reading part or all of the file, and then load a requested subset of the data into a store. NB. more than one file can be given, but it is assumed these files are "congruent"

  1. Declare an object, and give it a list of (Rinex Obs) files [cf. ctor(filename) or ctor(filenames) or member files(filenames)].
  2. Configure the object, using e.g. saveTheData(true), excludeSat(sat), etc
  3. Specify which ObsIDs to save - e.g. GC1* GC2* GL1* GL2*
  4. Run loadFiles(msg) to read the files (any error messages output in msg)
  5. Read the output: dumpSatObsTable() or dumpData() [if saved], and access output
  6. Optionally write the output to vector of SatPass with WriteSatPassList()
  7. Reset and go again reset() or reset(vector<files>)

Definition at line 85 of file Rinex3ObsFileLoader.hpp.

#include <Rinex3ObsFileLoader.hpp>

Public Member Functions

std::string asString ()
 
bool dataSaved ()
 
void dumpSatObsTable (std::ostream &s) const
 
void dumpStoreData (std::ostream &s) const
 
void dumpStoreEpoch (std::ostream &s, const gnsstk::Rinex3ObsData &rod) const
 
void excludeSat (SatID sat)
 
void excludeSats (std::vector< SatID > sats)
 
void files (std::vector< std::string > in_filenames)
 
CommonTime getDataBeginTime () const
 
CommonTime getDataEndTime () const
 
double getDT ()
 
Rinex3ObsHeader getFullHeader (unsigned int i) const
 
const std::vector< Rinex3ObsData > & getStore () const
 
const int getStoreSize () const
 
std::vector< int > getTotalObsCounts () const
 
std::vector< std::string > getWantedObsTypes () const
 
std::map< RinexSatID, std::vector< int > > getWantedSatObsCountMap () const
 
int loadFiles (std::string &errmsg, std::string &msg)
 
bool loadObsID (std::string srot)
 
void nEpochsToRead (int n)
 
void reset ()
 reset - called before reading another set of files, clears all info More...
 
void reset (std::vector< std::string > in_filenames)
 
 Rinex3ObsFileLoader ()
 empty constructor More...
 
 Rinex3ObsFileLoader (std::string in_filename)
 
 Rinex3ObsFileLoader (std::vector< std::string > in_filenames)
 
void saveTheData (bool b)
 
void setDecimation (double dt)
 
void setStartTime (const CommonTime &tt)
 
void setStopTime (const CommonTime &tt)
 
void setTimeFormat (std::string fmt)
 
int WriteSatPassList (const std::map< char, std::vector< std::string >> &obstypes, const std::map< char, std::vector< int >> &indexLoadOT, std::vector< SatPass > &SPList)
 

Private Member Functions

void init ()
 initialization used by the constructors More...
 

Private Attributes

CommonTime begDataTime
 
std::vector< int > countWantedObsTypes
 total counts per obs for wanted obs types (parallel to wantedObsTypes) More...
 
std::vector< Rinex3ObsDatadatastore
 vector of all input data - filled only if saveData is true. More...
 
double dtdec
 decimate to this time step More...
 
CommonTime endDataTime
 first and last times of data More...
 
std::vector< SatIDexSats
 exclude satellites, incl. (-1,sys) More...
 
std::vector< std::string > filenames
 input RINEX obs file names More...
 
std::vector< Rinex3ObsHeaderheaders
 headers from reading filenames More...
 
std::vector< std::string > inputWantedObsTypes
 
std::map< SatID, std::string > mapSatStr
 
MostCommonValue mcv
 estimator of the raw time interval More...
 
int nepochs
 number of epochs read More...
 
int nepochsToRead
 number of epochs to read (default:all) More...
 
double nominalDT
 nominal timestep (rawdt or dtdec) More...
 
std::vector< std::string > obstypes
 RINEX obs types found in data. More...
 
CommonTime prevtime
 used in reading loop for dt More...
 
double rawdt
 best est. of time interval, no decimate More...
 
std::map< RinexSatID, std::vector< int > > SatObsCountMap
 
bool saveData
 if true save the data (F) More...
 
CommonTime startTime
 
CommonTime stopTime
 edit to start and stop times More...
 
std::string timefmt
 format for time tags in output More...
 
std::vector< std::string > wantedObsTypes
 list of wanted RinexObsIDs, without any "*", which appear in header(s) More...
 

Static Private Attributes

static const double dttol
 tolerance in comparing times More...
 

Constructor & Destructor Documentation

◆ Rinex3ObsFileLoader() [1/3]

gnsstk::Rinex3ObsFileLoader::Rinex3ObsFileLoader ( )
inline

empty constructor

Definition at line 153 of file Rinex3ObsFileLoader.hpp.

◆ Rinex3ObsFileLoader() [2/3]

gnsstk::Rinex3ObsFileLoader::Rinex3ObsFileLoader ( std::string  in_filename)
inline

constructor with one file name

Parameters
[in]in_filenameRINEX obs file name to load

Definition at line 159 of file Rinex3ObsFileLoader.hpp.

◆ Rinex3ObsFileLoader() [3/3]

gnsstk::Rinex3ObsFileLoader::Rinex3ObsFileLoader ( std::vector< std::string >  in_filenames)
inline

constructor with vector of file names

Parameters
[in]in_filenamesvector of RINEX obs file names to load

Definition at line 171 of file Rinex3ObsFileLoader.hpp.

Member Function Documentation

◆ asString()

string gnsstk::Rinex3ObsFileLoader::asString ( )

write a summary of the entire loader configuration/output to a string

Returns
summary as a single string

Definition at line 495 of file Rinex3ObsFileLoader.cpp.

◆ dataSaved()

bool gnsstk::Rinex3ObsFileLoader::dataSaved ( )
inline

access save data flag

Returns
if true, then save the data, otherwise just the headers

Definition at line 272 of file Rinex3ObsFileLoader.hpp.

◆ dumpSatObsTable()

void gnsstk::Rinex3ObsFileLoader::dumpSatObsTable ( std::ostream &  s) const

Dump the SatObsCount table

Parameters
sto which to write the table

Definition at line 687 of file Rinex3ObsFileLoader.cpp.

◆ dumpStoreData()

void gnsstk::Rinex3ObsFileLoader::dumpStoreData ( std::ostream &  s) const

Dump the stored data - NB setTimeFormat()

Parameters
sto which to write the data

Definition at line 750 of file Rinex3ObsFileLoader.cpp.

◆ dumpStoreEpoch()

void gnsstk::Rinex3ObsFileLoader::dumpStoreEpoch ( std::ostream &  s,
const gnsstk::Rinex3ObsData rod 
) const

Dump the stored data for one epoch - NB setTimeFormat()

Parameters
sto which to write the data

Definition at line 716 of file Rinex3ObsFileLoader.cpp.

◆ excludeSat()

void gnsstk::Rinex3ObsFileLoader::excludeSat ( SatID  sat)
inline

satellites to be excluded; this may be SatID = (-1, system);

Parameters
[in]satsatellite to be excluded [do not exclude system this way]

Definition at line 305 of file Rinex3ObsFileLoader.hpp.

◆ excludeSats()

void gnsstk::Rinex3ObsFileLoader::excludeSats ( std::vector< SatID sats)
inline

vector of satellites to be excluded

Parameters
[in]satsvector of specific satellites to exclude

Definition at line 311 of file Rinex3ObsFileLoader.hpp.

◆ files()

void gnsstk::Rinex3ObsFileLoader::files ( std::vector< std::string >  in_filenames)
inline

Define the files to be loaded

Parameters
[in]in_filenamesvector of RINEX obs file names to load

Definition at line 221 of file Rinex3ObsFileLoader.hpp.

◆ getDataBeginTime()

CommonTime gnsstk::Rinex3ObsFileLoader::getDataBeginTime ( ) const
inline
Returns
beginning time of the entire dataset

Definition at line 326 of file Rinex3ObsFileLoader.hpp.

◆ getDataEndTime()

CommonTime gnsstk::Rinex3ObsFileLoader::getDataEndTime ( ) const
inline
Returns
end time of the entire dataset

Definition at line 329 of file Rinex3ObsFileLoader.hpp.

◆ getDT()

double gnsstk::Rinex3ObsFileLoader::getDT ( )
inline

return the raw data interval, unless decimation has been done, then return the decimated interval.

Returns
nominal time step of stored data (== raw and/or decimated)

Definition at line 365 of file Rinex3ObsFileLoader.hpp.

◆ getFullHeader()

Rinex3ObsHeader gnsstk::Rinex3ObsFileLoader::getFullHeader ( unsigned int  i) const
inline

return a full Rinex3ObsHeader

Parameters
[in]iindex in input filenames vector
Returns
Rinex3ObsHeader of corresponding file

Definition at line 372 of file Rinex3ObsFileLoader.hpp.

◆ getStore()

const std::vector<Rinex3ObsData>& gnsstk::Rinex3ObsFileLoader::getStore ( ) const
inline

access the data store

Returns
const ref to the datastore: vector<Rinex3ObsData>

Definition at line 387 of file Rinex3ObsFileLoader.hpp.

◆ getStoreSize()

const int gnsstk::Rinex3ObsFileLoader::getStoreSize ( ) const
inline

get the size of the data store

Returns
size (number of epochs) in the store

Definition at line 381 of file Rinex3ObsFileLoader.hpp.

◆ getTotalObsCounts()

std::vector<int> gnsstk::Rinex3ObsFileLoader::getTotalObsCounts ( ) const
inline

access total Obs counts for list of wanted ObsIDs

Returns
vector<int> total epoch counts for wanted obs types (parallel to wantedObsTypes)

Definition at line 355 of file Rinex3ObsFileLoader.hpp.

◆ getWantedObsTypes()

std::vector<std::string> gnsstk::Rinex3ObsFileLoader::getWantedObsTypes ( ) const
inline

access final list of wanted ObsIDs (no "*")

Returns
vector of strings, wanted ObsIDs as found in header(s)

Definition at line 335 of file Rinex3ObsFileLoader.hpp.

◆ getWantedSatObsCountMap()

std::map<RinexSatID, std::vector<int> > gnsstk::Rinex3ObsFileLoader::getWantedSatObsCountMap ( ) const
inline

access Sat/Obs counts for list of wanted ObsIDs

Returns
map<RinexSatID, vector<int>> of counts of data found for Sat/ObsID

Definition at line 346 of file Rinex3ObsFileLoader.hpp.

◆ init()

void gnsstk::Rinex3ObsFileLoader::init ( )
inlineprivate

initialization used by the constructors

Definition at line 141 of file Rinex3ObsFileLoader.hpp.

◆ loadFiles()

int gnsstk::Rinex3ObsFileLoader::loadFiles ( std::string &  errmsg,
std::string &  msg 
)

Read the files already defined

Parameters
[out]errmsgan error/warning message, blank for success
[out]msgan informative message
Returns
0 ok, >0 number of files read

Definition at line 75 of file Rinex3ObsFileLoader.cpp.

◆ loadObsID()

bool gnsstk::Rinex3ObsFileLoader::loadObsID ( std::string  srot)
inline

Add to list of RINEX 3 ObsIDs (4-character) that are desired for output Must be a valid 4-char ObsID, must begin with system character, and must not be a duplicate. E.g. GC1* GC2* GL1* GL2* JS1Z RL2C

Parameters
[in]srotstring RINEX 3 ObsID to save, must be 4-char, can use '*'
Returns
false if invalid input or not a valid ObsID

Definition at line 234 of file Rinex3ObsFileLoader.hpp.

◆ nEpochsToRead()

void gnsstk::Rinex3ObsFileLoader::nEpochsToRead ( int  n)
inline

limit the number of epochs to be read; set -1 (default) to read all

Parameters
[in]nmaximum number of epochs to read

Definition at line 260 of file Rinex3ObsFileLoader.hpp.

◆ reset() [1/2]

void gnsstk::Rinex3ObsFileLoader::reset ( )
inline

reset - called before reading another set of files, clears all info

Definition at line 179 of file Rinex3ObsFileLoader.hpp.

◆ reset() [2/2]

void gnsstk::Rinex3ObsFileLoader::reset ( std::vector< std::string >  in_filenames)
inline

reset with new filenames

Parameters
[in]in_filenamesvector of RINEX obs file names to load

Definition at line 208 of file Rinex3ObsFileLoader.hpp.

◆ saveTheData()

void gnsstk::Rinex3ObsFileLoader::saveTheData ( bool  b)
inline

set save data flag

Parameters
bif true, then save the data, otherwise just the headers

Definition at line 266 of file Rinex3ObsFileLoader.hpp.

◆ setDecimation()

void gnsstk::Rinex3ObsFileLoader::setDecimation ( double  dt)
inline

turn on decimation, to even seconds-of-week / this delta time

Parameters
[in]dtdecimate data to this time step (on even seconds-of-week)

Definition at line 291 of file Rinex3ObsFileLoader.hpp.

◆ setStartTime()

void gnsstk::Rinex3ObsFileLoader::setStartTime ( const CommonTime tt)
inline

set the start time

Parameters
[in]ttstart time, ignore data before this time

Definition at line 278 of file Rinex3ObsFileLoader.hpp.

◆ setStopTime()

void gnsstk::Rinex3ObsFileLoader::setStopTime ( const CommonTime tt)
inline

set the stop time

Parameters
[in]ttstop time, ignore data after this time

Definition at line 284 of file Rinex3ObsFileLoader.hpp.

◆ setTimeFormat()

void gnsstk::Rinex3ObsFileLoader::setTimeFormat ( std::string  fmt)
inline

set time format

Parameters
[in]fmtformat (cf. gnsstk::Epoch::printf) for time output in dumps

Definition at line 298 of file Rinex3ObsFileLoader.hpp.

◆ WriteSatPassList()

int gnsstk::Rinex3ObsFileLoader::WriteSatPassList ( const std::map< char, std::vector< std::string >> &  obstypes,
const std::map< char, std::vector< int >> &  indexLoadOT,
std::vector< SatPass > &  SPList 
)

Write the stored data to a list of SatPass objects, given a vector of obstypes and (for each system) a parallel vector of indexes into the Loader's ObsIDs (getWantedObsTypes()), and a vector of SatPass to be written to. SPList need not be empty; however if not empty, obstypes must be identical to those of existing SatPasses.

Parameters
[in]obstypesmap of <sys,vector<ObsID>> for SatPass (2or3-char obsID)
[in]indexLoadOTmap<char,vector<int>> with key=system char, value=vector parallel to obstypes with elements equal to {index in loader's ObsIDs for each obstype, or -1 if not in loader}
[in,out]SPListvector of SatPass to which data store is written
Returns
>0 number of passes created, -1 inconsistent input, -2 obstypes inconsistent with existing SatPass, -3 Loader not configured to save data, -4 no data -5 obstypes not provided for all systems

Definition at line 535 of file Rinex3ObsFileLoader.cpp.

Member Data Documentation

◆ begDataTime

CommonTime gnsstk::Rinex3ObsFileLoader::begDataTime
private

Definition at line 133 of file Rinex3ObsFileLoader.hpp.

◆ countWantedObsTypes

std::vector<int> gnsstk::Rinex3ObsFileLoader::countWantedObsTypes
private

total counts per obs for wanted obs types (parallel to wantedObsTypes)

Definition at line 116 of file Rinex3ObsFileLoader.hpp.

◆ datastore

std::vector<Rinex3ObsData> gnsstk::Rinex3ObsFileLoader::datastore
private

vector of all input data - filled only if saveData is true.

Definition at line 138 of file Rinex3ObsFileLoader.hpp.

◆ dtdec

double gnsstk::Rinex3ObsFileLoader::dtdec
private

decimate to this time step

Definition at line 96 of file Rinex3ObsFileLoader.hpp.

◆ dttol

const double gnsstk::Rinex3ObsFileLoader::dttol
staticprivate

tolerance in comparing times

Definition at line 88 of file Rinex3ObsFileLoader.hpp.

◆ endDataTime

CommonTime gnsstk::Rinex3ObsFileLoader::endDataTime
private

first and last times of data

Definition at line 133 of file Rinex3ObsFileLoader.hpp.

◆ exSats

std::vector<SatID> gnsstk::Rinex3ObsFileLoader::exSats
private

exclude satellites, incl. (-1,sys)

Definition at line 122 of file Rinex3ObsFileLoader.hpp.

◆ filenames

std::vector<std::string> gnsstk::Rinex3ObsFileLoader::filenames
private

input RINEX obs file names

Definition at line 91 of file Rinex3ObsFileLoader.hpp.

◆ headers

std::vector<Rinex3ObsHeader> gnsstk::Rinex3ObsFileLoader::headers
private

headers from reading filenames

Definition at line 135 of file Rinex3ObsFileLoader.hpp.

◆ inputWantedObsTypes

std::vector<std::string> gnsstk::Rinex3ObsFileLoader::inputWantedObsTypes
private

input list of wanted ObsIDs, may include "*"-the "any" sys/type/band/trk-code thus when the header is read this list is expanded into wantedObsTypes

Definition at line 104 of file Rinex3ObsFileLoader.hpp.

◆ mapSatStr

std::map<SatID, std::string> gnsstk::Rinex3ObsFileLoader::mapSatStr
private

map[sat]=string containing space-separated obs types to be read into SatPass cf. cfgEditObsTypes()

Definition at line 128 of file Rinex3ObsFileLoader.hpp.

◆ mcv

MostCommonValue gnsstk::Rinex3ObsFileLoader::mcv
private

estimator of the raw time interval

Definition at line 119 of file Rinex3ObsFileLoader.hpp.

◆ nepochs

int gnsstk::Rinex3ObsFileLoader::nepochs
private

number of epochs read

Definition at line 131 of file Rinex3ObsFileLoader.hpp.

◆ nepochsToRead

int gnsstk::Rinex3ObsFileLoader::nepochsToRead
private

number of epochs to read (default:all)

Definition at line 92 of file Rinex3ObsFileLoader.hpp.

◆ nominalDT

double gnsstk::Rinex3ObsFileLoader::nominalDT
private

nominal timestep (rawdt or dtdec)

Definition at line 132 of file Rinex3ObsFileLoader.hpp.

◆ obstypes

std::vector<std::string> gnsstk::Rinex3ObsFileLoader::obstypes
private

RINEX obs types found in data.

Definition at line 134 of file Rinex3ObsFileLoader.hpp.

◆ prevtime

CommonTime gnsstk::Rinex3ObsFileLoader::prevtime
private

used in reading loop for dt

Definition at line 120 of file Rinex3ObsFileLoader.hpp.

◆ rawdt

double gnsstk::Rinex3ObsFileLoader::rawdt
private

best est. of time interval, no decimate

Definition at line 121 of file Rinex3ObsFileLoader.hpp.

◆ SatObsCountMap

std::map<RinexSatID, std::vector<int> > gnsstk::Rinex3ObsFileLoader::SatObsCountMap
private

count of prn/obs for wanted obs types NB the vector<int> is parallel to wantedObsTypes;

Definition at line 113 of file Rinex3ObsFileLoader.hpp.

◆ saveData

bool gnsstk::Rinex3ObsFileLoader::saveData
private

if true save the data (F)

Definition at line 93 of file Rinex3ObsFileLoader.hpp.

◆ startTime

CommonTime gnsstk::Rinex3ObsFileLoader::startTime
private

Definition at line 97 of file Rinex3ObsFileLoader.hpp.

◆ stopTime

CommonTime gnsstk::Rinex3ObsFileLoader::stopTime
private

edit to start and stop times

Definition at line 97 of file Rinex3ObsFileLoader.hpp.

◆ timefmt

std::string gnsstk::Rinex3ObsFileLoader::timefmt
private

format for time tags in output

Definition at line 94 of file Rinex3ObsFileLoader.hpp.

◆ wantedObsTypes

std::vector<std::string> gnsstk::Rinex3ObsFileLoader::wantedObsTypes
private

list of wanted RinexObsIDs, without any "*", which appear in header(s)

Definition at line 107 of file Rinex3ObsFileLoader.hpp.


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


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