IonexData Class Reference
[IONEX format file I/O]

#include <IonexData.hpp>

Inheritance diagram for IonexData:

Inheritance graph
[legend]
Collaboration diagram for IonexData:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class models a IONEX Data Record.

See also:
gpstk::IonexStream and gpstk::IonexHeader

main ionex test.cpp for example

Definition at line 56 of file IonexData.hpp.

Public Member Functions

 IonexData ()
 Default constructor.
virtual ~IonexData ()
 Destructor.
virtual bool isData () const
 IonexData is a "data", so this function always returns true.
virtual bool isValid () const
 Am I an valid object?
virtual void dump (std::ostream &s=std::cout) const
 A debug output function.
int getIndex (const Triple &in, const int &type, Triple &out) const throw (InvalidRequest)
 Get the position of a grid point based on input position.
double getValue (const Position &pos) const throw (InvalidRequest,FFStreamError)
 Get IONEX TEC or RMS value as a function of the position and nominal height.

Public Attributes

IonexDataValues
int mapID
 denote the internal number of the current map
int dim [3]
 How many values are along latitude, longitude, height.
CommonTime time
 the time corresponding to the current data records
IonexValType type
 Type of data either TEC or RMS.
Vector< double > data
 TEC or RMS data.
int exponent
 Exponent defining the unit of the values.
double lat [3]
 Definition of a grid in latitude.
double lon [3]
 Definition of a grid in longitude.
double hgt [3]
 Definition of a grid in height.
bool valid
 Validity flag.

Static Public Attributes

IonexDataFormatStrings
IONEX Data Formatting Strings

const std::string startTecMapString = "START OF TEC MAP"
 "START OF TEC MAP"
const std::string startRmsMapString = "START OF RMS MAP"
 "START OF RMS MAP"
const std::string startHgtMapString = "START OF HEIGHT MAP"
 "START OF HEIGHT MAP"
const std::string currentEpochString = "EPOCH OF CURRENT MAP"
 "EPOCH OF CURRENT MAP"
const std::string dataBlockString = "LAT/LON1/LON2/DLON/H"
 "LAT/LON1/LON2/DLON/H"
const std::string endTecMapString = "END OF TEC MAP"
 "END OF TEC MAP"
const std::string endRmsMapString = "END OF RMS MAP"
 "END OF RMS MAP"
const std::string endHgtMapString = "END OF HEIGHT MAP"
 "END OF HEIGHT MAP"
const std::string endOfFile = "END OF FILE"
 "END OF FILE"
Standard IONEX value types
const IonexValType UN
const IonexValType TEC
const IonexValType RMS

Protected Member Functions

virtual void reallyPutRecord (FFStream &s) const throw ( std::exception, FFStreamError, gpstk::StringUtils::StringException )
 Writes a correctly formatted record from this data to stream s.
virtual void reallyGetRecord (FFStream &s) throw ( std::exception, FFStreamError, gpstk::StringUtils::StringException )
 This function obtains a IONEX Data record from the given FFStream.


Constructor & Destructor Documentation

IonexData  )  [inline]
 

Default constructor.

Definition at line 131 of file IonexData.hpp.

References gpstk::BEGINNING_OF_TIME.

virtual ~IonexData  )  [inline, virtual]
 

Destructor.

Definition at line 136 of file IonexData.hpp.


Member Function Documentation

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

A debug output function.

Reimplemented from FFData.

Definition at line 418 of file IonexData.cpp.

References IonexData::data, IonexData::dim, IonexData::isValid(), IonexData::mapID, Vector::size(), IonexData::time, IonexData::IonexValType::type, IonexData::type, and IonexData::IonexValType::units.

int getIndex const Triple in,
const int &  type,
Triple out
const throw (InvalidRequest)
 

Get the position of a grid point based on input position.

Parameters:
in input lat, lon and height (Triple object)
type grid point to be returned (1) neareast grid point (2) lower left hand grid point
out output lat, lon and height (Triple object)
Returns:
the index within the data
Warning:
Keep in mind the assumptions of IONEX grid (i.e., latitude between [87.5, -87.5], longitude between [-180, 180]) when you construct a Triple object.

Definition at line 453 of file IonexData.cpp.

References gpstk::abs(), gpstk::StringUtils::asString(), and GPSTK_THROW.

double getValue const Position pos  )  const throw (InvalidRequest,FFStreamError)
 

Get IONEX TEC or RMS value as a function of the position and nominal height.

A simple 4-point formula is applied to interpolate between grid points.

For more information see page 3 of IONEX manual:

http://igscb.jpl.nasa.gov/igscb/data/format/ionex1.pdf

Parameters:
pos input position (Position object).
Returns:
Computed TEC or RMS value.

Definition at line 586 of file IonexData.cpp.

References WGS84Ellipsoid::a(), gpstk::beta(), Position::getSystemName(), and GPSTK_THROW.

Referenced by IonexStore::getIonexValue().

virtual bool isData void   )  const [inline, virtual]
 

IonexData is a "data", so this function always returns true.

Reimplemented from FFData.

Definition at line 143 of file IonexData.hpp.

virtual bool isValid void   )  const [inline, virtual]
 

Am I an valid object?

Definition at line 148 of file IonexData.hpp.

Referenced by IonexData::dump(), and IonexStore::loadFile().

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

This function obtains a IONEX Data record from the given FFStream.

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

Exceptions:
StringException when a StringUtils 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 205 of file IonexData.cpp.

References gpstk::StringUtils::asDouble(), gpstk::StringUtils::asInt(), IonexHeader::exponent, FFTextStream::formattedGetLine(), GPSTK_THROW, IonexStream::header, IonexStream::headerRead, IonexHeader::hgt, IonexHeader::lat, IonexHeader::lon, gpstk::pow(), and gpstk::StringUtils::stripTrailing().

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

Writes a correctly formatted record from this data to stream s.

Exceptions:
StringException when a StringUtils function fails

Implements FFData.

Definition at line 69 of file IonexData.cpp.

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


Member Data Documentation

const string currentEpochString = "EPOCH OF CURRENT MAP" [static]
 

"EPOCH OF CURRENT MAP"

Definition at line 47 of file IonexData.cpp.

Vector<double> data
 

TEC or RMS data.

Definition at line 117 of file IonexData.hpp.

Referenced by IonexData::dump().

const string dataBlockString = "LAT/LON1/LON2/DLON/H" [static]
 

"LAT/LON1/LON2/DLON/H"

Definition at line 48 of file IonexData.cpp.

int dim[3]
 

How many values are along latitude, longitude, height.

Definition at line 113 of file IonexData.hpp.

Referenced by IonexData::dump().

const string endHgtMapString = "END OF HEIGHT MAP" [static]
 

"END OF HEIGHT MAP"

Definition at line 51 of file IonexData.cpp.

const string endOfFile = "END OF FILE" [static]
 

"END OF FILE"

Definition at line 52 of file IonexData.cpp.

const string endRmsMapString = "END OF RMS MAP" [static]
 

"END OF RMS MAP"

Definition at line 50 of file IonexData.cpp.

const string endTecMapString = "END OF TEC MAP" [static]
 

"END OF TEC MAP"

Definition at line 49 of file IonexData.cpp.

int exponent
 

Exponent defining the unit of the values.

Definition at line 120 of file IonexData.hpp.

double hgt[3]
 

Definition of a grid in height.

Definition at line 124 of file IonexData.hpp.

double lat[3]
 

Definition of a grid in latitude.

Definition at line 122 of file IonexData.hpp.

double lon[3]
 

Definition of a grid in longitude.

Definition at line 123 of file IonexData.hpp.

int mapID
 

denote the internal number of the current map

Definition at line 112 of file IonexData.hpp.

Referenced by IonexData::dump().

const IonexData::IonexValType RMS [static]
 

const string startHgtMapString = "START OF HEIGHT MAP" [static]
 

"START OF HEIGHT MAP"

Definition at line 46 of file IonexData.cpp.

const string startRmsMapString = "START OF RMS MAP" [static]
 

"START OF RMS MAP"

Definition at line 45 of file IonexData.cpp.

const string startTecMapString = "START OF TEC MAP" [static]
 

"START OF TEC MAP"

Definition at line 44 of file IonexData.cpp.

const IonexData::IonexValType TEC [static]
 

CommonTime time
 

the time corresponding to the current data records

Definition at line 114 of file IonexData.hpp.

Referenced by IonexData::dump().

IonexValType type
 

Type of data either TEC or RMS.

Definition at line 116 of file IonexData.hpp.

Referenced by IonexData::dump().

const IonexData::IonexValType UN [static]
 

bool valid
 

Validity flag.

Definition at line 126 of file IonexData.hpp.


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