IonexData.hpp

Go to the documentation of this file.
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 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Octavian Andrei - FGI ( http://www.fgi.fi ). 2008, 2009
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       }; // End of struct 'IonexValType'
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          // The following fields are similar to the ones in 'IonexHeader'
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          // The next four lines define our common interface
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    }; // End of class 'IonexData'
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 }  // End of namespace gpstk
00276 #endif   // GPSTK_IONEXDATA_HPP

Generated on Thu Sep 9 03:30:53 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1