00001 #pragma ident "$Id: IonexData.hpp 1802 2009-03-17 13:20:40Z coandrei $"
00002
00008 #ifndef GPSTK_IONEXDATA_HPP
00009 #define GPSTK_IONEXDATA_HPP
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include <map>
00035
00036 #include "FFStream.hpp"
00037 #include "Position.hpp"
00038 #include "Vector.hpp"
00039 #include "WGS84Geoid.hpp"
00040
00041 #include "IonexStream.hpp"
00042
00043
00044
00045 namespace gpstk
00046 {
00047
00050
00056 class IonexData : public IonexBase
00057 {
00058 public:
00059
00060
00066 static const std::string startTecMapString;
00067 static const std::string startRmsMapString;
00068 static const std::string startHgtMapString;
00069 static const std::string currentEpochString;
00070 static const std::string dataBlockString;
00071 static const std::string endTecMapString;
00072 static const std::string endRmsMapString;
00073 static const std::string endHgtMapString;
00074 static const std::string endOfFile;
00075
00076
00077
00079 struct IonexValType
00080 {
00081
00082 std::string type;
00083 std::string description;
00084 std::string units;
00085
00086 IonexValType()
00087 : type( std::string("UN") ),
00088 description( std::string("Unknown or Invalid") ),
00089 units( std::string("") )
00090 {};
00091
00092 IonexValType(std::string t, std::string d, std::string u)
00093 : type(t), description(d), units(u) {};
00094
00095 };
00096
00097
00102 static const IonexValType UN;
00103 static const IonexValType TEC;
00104 static const IonexValType RMS;
00106
00107
00112 int mapID;
00113 int dim[3];
00114 DayTime time;
00115
00116 IonexValType type;
00117 Vector<double> data;
00118
00119
00120 int exponent;
00121
00122 double lat[3];
00123 double lon[3];
00124 double hgt[3];
00125
00126 bool valid;
00127
00128
00129
00131 IonexData()
00132 : time(DayTime::BEGINNING_OF_TIME), valid(false) {};
00133
00134
00136 virtual ~IonexData() {};
00137
00138
00139
00140
00141
00143 virtual bool isData() const
00144 { return true; }
00145
00146
00148 virtual bool isValid() const
00149 { return valid; };
00150
00151
00153 virtual void dump (std::ostream& s = std::cout) const;
00154
00155
00169 int getIndex( const Triple& in, const int& type, Triple& out ) const
00170 throw(InvalidRequest);
00171
00172
00188 double getValue(const Position& pos) const
00189 throw(InvalidRequest,FFStreamError);
00190
00191
00192 protected:
00193
00198 virtual void reallyPutRecord(FFStream& s) const
00199 throw( std::exception,
00200 FFStreamError,
00201 gpstk::StringUtils::StringException );
00202
00203
00215 virtual void reallyGetRecord(FFStream& s)
00216 throw( std::exception,
00217 FFStreamError,
00218 gpstk::StringUtils::StringException );
00219
00220
00221 private:
00222
00223
00229 std::string writeTime(const DayTime& dt) const
00230 throw(gpstk::StringUtils::StringException);
00231
00232
00238 DayTime parseTime(const std::string& line) const;
00239
00240
00241 };
00242
00243
00245 inline bool operator==( const IonexData::IonexValType& x,
00246 const IonexData::IonexValType& y )
00247 {return (x.type == y.type); };
00248
00249
00251 inline bool operator!=( const IonexData::IonexValType& x,
00252 const IonexData::IonexValType& y )
00253 {return (x.type != y.type); };
00254
00255
00257 inline bool operator<( const IonexData::IonexValType& x,
00258 const IonexData::IonexValType& y )
00259 {return (x.type < y.type); };
00260
00261
00263 inline std::ostream& operator<<( std::ostream& s,
00264 const IonexData::IonexValType ivt )
00265 {
00266 return s << "Type= " << ivt.type
00267 << ", Description= " << ivt.description
00268 << ", Units= " << ivt.units;
00269 };
00270
00271
00273
00274
00275 }
00276 #endif // GPSTK_IONEXDATA_HPP