IonexHeader Class Reference
[IONEX format file I/O]

#include <IonexHeader.hpp>

Inheritance diagram for IonexHeader:

Inheritance graph
[legend]
Collaboration diagram for IonexHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class models the header for a IONEX file.

See also:
gpstk::IonexData and IonexStream

main_ionex_test.cpp for an example

Definition at line 56 of file IonexHeader.hpp.

IonexHeaderValues

typedef std::map< SatID, DCBSatDCBMap
 The key to this map is the svid of the satellite (usually the prn).
double version
 IONEX version.
std::string fileType
 IONEX filetype ('I' for Ionoshere Maps).
std::string system
 Satellite system or theoretical model.
std::string fileProgram
 Name of program creating this file.
std::string fileAgency
 Name of agency creating this file.
std::string date
 Date and time of file creation.
std::vector< std::string > descriptionList
 Descriptions in header (opt).
std::vector< std::string > commentList
 Comments in header(optional).
CommonTime firstEpoch
 Epoch of first map.
CommonTime lastEpoch
 Epoch of last map.
int interval
 Time interval between maps (seconds).
size_t numMaps
 Total number of TEC/RMS/HGT maps.
std::string mappingFunction
 Mapping function adopted.
double elevation
 Minimum elevation angle, in degrees.
std::string observablesUsed
 One-line specification of used obs.
size_t numStations
 Number of contributing stations (optional).
size_t numSVs
 Number of contributing satellites (opt).
double baseRadius
 Mean earth radius, or bottom of height grid (km).
size_t mapDims
 Dimension of maps (2 or 3).
double hgt [3]
 Definition of an equidistand grid in height 'hgt[0]' to 'hgt[1]' with increment 'hgt[2]' in km For 2-dimensional maps hgt[0]=hgt[1] and hgt[2]=0.
double lat [3]
 Definition of the grid in latitude 'lat[0]' to 'lat[1]' with increment 'hgt[2]' in deg.
double lon [3]
 Definition of the grid in longitude 'lon[0]' to 'lon[1]' with increment 'hon[2]' in deg.
int exponent
 Exponent defining the unit of the values (optional).
std::string auxData
 Type of auxiliar data (optional).
SatDCBMap svsmap
 Map of satellites' DCBs (in nanoseconds).
bool auxDataFlag
 Flag to monitor the sequence of auxiliar data.
bool valid
 return code, Am I valid?

Public Member Functions

 IonexHeader ()
 Default constructor.
void clear (void)
 Clear (empty out) header.
virtual ~IonexHeader ()
 Destructor.
virtual bool isHeader () const
 Returns whether or not this class is a header.
virtual void dump (std::ostream &s=std::cout) const
 Simple debug output function.
void ParseDcbRecord (std::string &line) throw (FFStreamError)
 Parse a single auxiliary header record that contains "Differential code biases".
void ParseHeaderRecord (std::string &line) throw (FFStreamError)
 Parse a single header record, and modify 'valid' accordingly.
void WriteHeaderRecords (FFStream &s) const throw (FFStreamError, gpstk::StringUtils::StringException)
 Write all valid header records to the given stream.

Static Public Attributes

IonexHeaderFormatStrings
IONEX Header Formatting Strings

const std::string versionString = "IONEX VERSION / TYPE"
 "IONEXVERSION / TYPE"
const std::string runByString = "PGM / RUN BY / DATE"
 "PGM / RUN BY / DATE"
const std::string descriptionString = "DESCRIPTION"
 "DESCRIPTION"
const std::string commentString = "COMMENT"
 "COMMENT"
const std::string firstTimeString = "EPOCH OF FIRST MAP"
 "EPOCH OF FIRST MAP"
const std::string lastTimeString = "EPOCH OF LAST MAP"
 "EPOCH OF LAST MAP"
const std::string intervalString = "INTERVAL"
 "INTERVAL"
const std::string numMapsString = "# OF MAPS IN FILE"
 "# OF MAPS IN FILE"
const std::string mappingFunctionString = "MAPPING FUNCTION"
 "MAPPING FUNCTION"
const std::string elevationString = "ELEVATION CUTOFF"
 "ELEVATION CUTOFF"
const std::string observablesUsedString = "OBSERVABLES USED"
 "OBSERVABLES USED"
const std::string numStationsString = "# OF STATIONS"
 "# OF STATIONS"
const std::string numSatsString = "# OF SATELLITES"
 "# OF SATELLITES"
const std::string baseRadiusString = "BASE RADIUS"
 "BASE RADIUS"
const std::string mapDimensionString = "MAP DIMENSION"
 "MAP DIMENSION"
const std::string hgtGridString = "HGT1 / HGT2 / DHGT"
 "HGT1 / HGT2 / DHGT"
const std::string latGridString = "LAT1 / LAT2 / DLAT"
 "LAT1 / LAT2 / DLAT"
const std::string lonGridString = "LON1 / LON2 / DLON"
 "LON1 / LON2 / DLON"
const std::string exponentString = "EXPONENT"
 "EXPONENT"
const std::string startAuxDataString = "START OF AUX DATA"
 "START OF AUX DATA"
const std::string endAuxDataString = "END OF AUX DATA"
 "END OF AUX DATA"
const std::string endOfHeader = "END OF HEADER"
 "END OF HEADER"

Protected Member Functions

virtual void reallyPutRecord (FFStream &s) const throw ( std::exception, FFStreamError, StringUtils::StringException )
 Writes the record formatted to the FFStream s.
virtual void reallyGetRecord (FFStream &s) throw ( std::exception, FFStreamError, StringUtils::StringException)
 This function retrieves the IONEX header from the given FFStream.

Friends

class IonexData


Member Typedef Documentation

typedef std::map<SatID,DCB> SatDCBMap
 

The key to this map is the svid of the satellite (usually the prn).

Definition at line 211 of file IonexHeader.hpp.


Constructor & Destructor Documentation

IonexHeader  )  [inline]
 

Default constructor.

Definition at line 61 of file IonexHeader.hpp.

virtual ~IonexHeader  )  [inline, virtual]
 

Destructor.

Definition at line 221 of file IonexHeader.hpp.


Member Function Documentation

void clear void   ) 
 

Clear (empty out) header.

Definition at line 73 of file IonexHeader.cpp.

References IonexHeader::auxDataFlag, IonexHeader::baseRadius, IonexHeader::commentList, IonexHeader::descriptionList, IonexHeader::elevation, IonexHeader::exponent, IonexHeader::hgt, IonexHeader::interval, IonexHeader::lat, IonexHeader::lon, IonexHeader::mapDims, IonexHeader::numMaps, IonexHeader::numStations, IonexHeader::numSVs, IonexHeader::svsmap, IonexHeader::valid, and IonexHeader::version.

Referenced by IonexStore::clear().

void dump std::ostream &  s = std::cout  )  const [virtual]
 

Simple debug output function.

It simply outputs the version, name and number of maps contained in this Ionex header.

Reimplemented from FFData.

Definition at line 102 of file IonexHeader.cpp.

References IonexHeader::elevation, IonexHeader::firstEpoch, IonexHeader::hgt, IonexHeader::interval, IonexHeader::lastEpoch, IonexHeader::lat, IonexHeader::lon, IonexHeader::mapDims, IonexHeader::mappingFunction, IonexHeader::numMaps, IonexHeader::numStations, IonexHeader::numSVs, and IonexHeader::valid.

virtual bool isHeader void   )  const [inline, virtual]
 

Returns whether or not this class is a header.

Have your overriding function return the correct value.

Reimplemented from FFData.

Definition at line 225 of file IonexHeader.hpp.

void ParseDcbRecord std::string &  line  )  throw (FFStreamError)
 

Parse a single auxiliary header record that contains "Differential code biases".

Definition at line 142 of file IonexHeader.cpp.

References gpstk::StringUtils::asDouble(), gpstk::StringUtils::asInt(), GPSTK_THROW, and gpstk::StringUtils::strip().

void ParseHeaderRecord std::string &  line  )  throw (FFStreamError)
 

Parse a single header record, and modify 'valid' accordingly.

Used by reallyGetRecord for both IonexHeader and IonexData.

Definition at line 223 of file IonexHeader.cpp.

References gpstk::StringUtils::asDouble(), gpstk::StringUtils::asInt(), GPSTK_THROW, and gpstk::StringUtils::strip().

void reallyGetRecord FFStream s  )  throw ( std::exception, FFStreamError, StringUtils::StringException) [protected, virtual]
 

This function retrieves the IONEX header from the given FFStream.

If an stream error is encountered, the stream is reset to its original position and its fail-bit is set.

Exceptions:
StringException when a StringUtilis function fails
FFStreamError when exceptions (failbit) is set and a read or formatting error occurs. This also resets the stream to its pre-read position.

Implements FFData.

Definition at line 385 of file IonexHeader.cpp.

References ABS, gpstk::StringUtils::asString(), FFTextStream::formattedGetLine(), GPSTK_RETHROW, GPSTK_THROW, IonexStream::header, IonexStream::headerRead, and gpstk::StringUtils::stripTrailing().

void reallyPutRecord FFStream s  )  const throw ( std::exception, FFStreamError, StringUtils::StringException ) [protected, virtual]
 

Writes the record formatted to the FFStream s.

Exceptions:
StringException when a StringUtils function fails

Implements FFData.

Definition at line 538 of file IonexHeader.cpp.

References Exception::addText(), gpstk::StringUtils::asString(), GPSTK_RETHROW, and GPSTK_THROW.

void WriteHeaderRecords FFStream s  )  const throw (FFStreamError, gpstk::StringUtils::StringException)
 

Write all valid header records to the given stream.

Used by reallyPutRecord for both IonexHeader and IonexData.

Definition at line 568 of file IonexHeader.cpp.

References gpstk::StringUtils::asString(), GPSTK_THROW, gpstk::StringUtils::leftJustify(), FFTextStream::lineNumber, and gpstk::StringUtils::rightJustify().


Friends And Related Function Documentation

friend class IonexData [friend]
 

Definition at line 288 of file IonexHeader.hpp.


Member Data Documentation

std::string auxData
 

Type of auxiliar data (optional).

Definition at line 208 of file IonexHeader.hpp.

bool auxDataFlag
 

Flag to monitor the sequence of auxiliar data.

Definition at line 214 of file IonexHeader.hpp.

Referenced by IonexHeader::clear().

double baseRadius
 

Mean earth radius, or bottom of height grid (km).

Definition at line 196 of file IonexHeader.hpp.

Referenced by IonexHeader::clear().

const string baseRadiusString = "BASE RADIUS" [static]
 

"BASE RADIUS"

Definition at line 57 of file IonexHeader.cpp.

std::vector<std::string> commentList
 

Comments in header(optional).

Definition at line 182 of file IonexHeader.hpp.

Referenced by IonexHeader::clear().

const string commentString = "COMMENT" [static]
 

"COMMENT"

Definition at line 47 of file IonexHeader.cpp.

std::string date
 

Date and time of file creation.

Definition at line 179 of file IonexHeader.hpp.

std::vector<std::string> descriptionList
 

Descriptions in header (opt).

Definition at line 181 of file IonexHeader.hpp.

Referenced by IonexHeader::clear().

const string descriptionString = "DESCRIPTION" [static]
 

"DESCRIPTION"

Definition at line 46 of file IonexHeader.cpp.

double elevation
 

Minimum elevation angle, in degrees.

Definition at line 190 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

const string elevationString = "ELEVATION CUTOFF" [static]
 

"ELEVATION CUTOFF"

Definition at line 53 of file IonexHeader.cpp.

const string endAuxDataString = "END OF AUX DATA" [static]
 

"END OF AUX DATA"

Definition at line 64 of file IonexHeader.cpp.

const string endOfHeader = "END OF HEADER" [static]
 

"END OF HEADER"

Definition at line 65 of file IonexHeader.cpp.

int exponent
 

Exponent defining the unit of the values (optional).

Definition at line 207 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexData::reallyGetRecord().

const string exponentString = "EXPONENT" [static]
 

"EXPONENT"

Definition at line 62 of file IonexHeader.cpp.

std::string fileAgency
 

Name of agency creating this file.

Definition at line 178 of file IonexHeader.hpp.

std::string fileProgram
 

Name of program creating this file.

Definition at line 177 of file IonexHeader.hpp.

std::string fileType
 

IONEX filetype ('I' for Ionoshere Maps).

Definition at line 175 of file IonexHeader.hpp.

CommonTime firstEpoch
 

Epoch of first map.

Definition at line 184 of file IonexHeader.hpp.

Referenced by IonexHeader::dump().

const string firstTimeString = "EPOCH OF FIRST MAP" [static]
 

"EPOCH OF FIRST MAP"

Definition at line 48 of file IonexHeader.cpp.

double hgt[3]
 

Definition of an equidistand grid in height 'hgt[0]' to 'hgt[1]' with increment 'hgt[2]' in km For 2-dimensional maps hgt[0]=hgt[1] and hgt[2]=0.

Definition at line 199 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), IonexHeader::dump(), and IonexData::reallyGetRecord().

const string hgtGridString = "HGT1 / HGT2 / DHGT" [static]
 

"HGT1 / HGT2 / DHGT"

Definition at line 59 of file IonexHeader.cpp.

int interval
 

Time interval between maps (seconds).

Definition at line 187 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

const string intervalString = "INTERVAL" [static]
 

"INTERVAL"

Definition at line 50 of file IonexHeader.cpp.

CommonTime lastEpoch
 

Epoch of last map.

Definition at line 185 of file IonexHeader.hpp.

Referenced by IonexHeader::dump().

const string lastTimeString = "EPOCH OF LAST MAP" [static]
 

"EPOCH OF LAST MAP"

Definition at line 49 of file IonexHeader.cpp.

double lat[3]
 

Definition of the grid in latitude 'lat[0]' to 'lat[1]' with increment 'hgt[2]' in deg.

Definition at line 202 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), IonexHeader::dump(), and IonexData::reallyGetRecord().

const string latGridString = "LAT1 / LAT2 / DLAT" [static]
 

"LAT1 / LAT2 / DLAT"

Definition at line 60 of file IonexHeader.cpp.

double lon[3]
 

Definition of the grid in longitude 'lon[0]' to 'lon[1]' with increment 'hon[2]' in deg.

Definition at line 204 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), IonexHeader::dump(), and IonexData::reallyGetRecord().

const string lonGridString = "LON1 / LON2 / DLON" [static]
 

"LON1 / LON2 / DLON"

Definition at line 61 of file IonexHeader.cpp.

const string mapDimensionString = "MAP DIMENSION" [static]
 

"MAP DIMENSION"

Definition at line 58 of file IonexHeader.cpp.

size_t mapDims
 

Dimension of maps (2 or 3).

Definition at line 197 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

std::string mappingFunction
 

Mapping function adopted.

Definition at line 189 of file IonexHeader.hpp.

Referenced by IonexHeader::dump().

const string mappingFunctionString = "MAPPING FUNCTION" [static]
 

"MAPPING FUNCTION"

Definition at line 52 of file IonexHeader.cpp.

size_t numMaps
 

Total number of TEC/RMS/HGT maps.

Definition at line 188 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

const string numMapsString = "# OF MAPS IN FILE" [static]
 

"# OF MAPS IN FILE"

Definition at line 51 of file IonexHeader.cpp.

const string numSatsString = "# OF SATELLITES" [static]
 

"# OF SATELLITES"

Definition at line 56 of file IonexHeader.cpp.

size_t numStations
 

Number of contributing stations (optional).

Definition at line 193 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

const string numStationsString = "# OF STATIONS" [static]
 

"# OF STATIONS"

Definition at line 55 of file IonexHeader.cpp.

size_t numSVs
 

Number of contributing satellites (opt).

Definition at line 194 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

std::string observablesUsed
 

One-line specification of used obs.

Definition at line 191 of file IonexHeader.hpp.

const string observablesUsedString = "OBSERVABLES USED" [static]
 

"OBSERVABLES USED"

Definition at line 54 of file IonexHeader.cpp.

const string runByString = "PGM / RUN BY / DATE" [static]
 

"PGM / RUN BY / DATE"

Definition at line 45 of file IonexHeader.cpp.

const string startAuxDataString = "START OF AUX DATA" [static]
 

"START OF AUX DATA"

Definition at line 63 of file IonexHeader.cpp.

SatDCBMap svsmap
 

Map of satellites' DCBs (in nanoseconds).

Definition at line 213 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexStore::loadFile().

std::string system
 

Satellite system or theoretical model.

Definition at line 176 of file IonexHeader.hpp.

bool valid
 

return code, Am I valid?

Definition at line 217 of file IonexHeader.hpp.

Referenced by IonexHeader::clear(), and IonexHeader::dump().

double version
 

IONEX version.

Definition at line 173 of file IonexHeader.hpp.

Referenced by IonexHeader::clear().

const string versionString = "IONEX VERSION / TYPE" [static]
 

"IONEXVERSION / TYPE"

Definition at line 44 of file IonexHeader.cpp.


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