AntexData.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: AntexData.hpp 2293 2010-02-12 18:14:16Z btolman $"
00002 
00011 #ifndef ANTEX_DATA_HPP
00012 #define ANTEX_DATA_HPP
00013 
00014 //============================================================================
00015 //
00016 //  This file is part of GPSTk, the GPS Toolkit.
00017 //
00018 //  The GPSTk is free software; you can redistribute it and/or modify
00019 //  it under the terms of the GNU Lesser General Public License as published
00020 //  by the Free Software Foundation; either version 2.1 of the License, or
00021 //  any later version.
00022 //
00023 //  The GPSTk is distributed in the hope that it will be useful,
00024 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 //  GNU Lesser General Public License for more details.
00027 //
00028 //  You should have received a copy of the GNU Lesser General Public
00029 //  License along with GPSTk; if not, write to the Free Software Foundation,
00030 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00031 //  
00032 //  Copyright 2004, The University of Texas at Austin
00033 //
00034 //============================================================================
00035 
00036 //============================================================================
00037 //
00038 //This software developed by Applied Research Laboratories at the University of
00039 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00040 //Department of Defense. The U.S. Government retains all rights to use,
00041 //duplicate, distribute, disclose, or release this software. 
00042 //
00043 //Pursuant to DoD Directive 523024 
00044 //
00045 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00046 //                           release, distribution is unlimited.
00047 //
00048 //=============================================================================
00049 
00050 #include <string>
00051 #include <vector>
00052 #include <map>
00053 
00054 #include "AntexBase.hpp"
00055 #include "FFStream.hpp"
00056 #include "DayTime.hpp"
00057 #include "Triple.hpp"
00058 
00059 namespace gpstk
00060 {
00063 
00109    class AntexData : public AntexBase
00110    {
00111    public:
00114 
00115       static const std::string startAntennaString;    
00116       static const std::string typeSerNumString;      
00117       static const std::string methodString;          
00118       static const std::string daziString;            
00119       static const std::string zenithString;          
00120       static const std::string numFreqString;         
00121       static const std::string validFromString;       
00122       static const std::string validUntilString;      
00123       static const std::string sinexCodeString;       
00124       static const std::string dataCommentString;     
00125       static const std::string startFreqString;       
00126       static const std::string neuFreqString;         
00127       static const std::string endOfFreqString;       
00128       static const std::string startFreqRMSString;    
00129       static const std::string neuFreqRMSString;      
00130       static const std::string endOfFreqRMSString;    
00131       static const std::string endOfAntennaString;    
00132 
00133 
00136       enum validBits
00137       {
00138          startAntennaValid = 0x00001,  
00139          typeSerNumValid   = 0x00002,  
00140          methodValid       = 0x00004,  
00141          daziValid         = 0x00008,  
00142          zenithValid       = 0x00010,  
00143          numFreqValid      = 0x00020,  
00144          validFromValid    = 0x00040,  
00145          validUntilValid   = 0x00080,  
00146          sinexCodeValid    = 0x00100,  
00147          dataCommentValid  = 0x00200,  
00148          startFreqValid    = 0x00400,  
00149          neuFreqValid      = 0x00800,  
00150          endOfFreqValid    = 0x01000,  
00151          startFreqRMSValid = 0x02000,  
00152          neuFreqRMSValid   = 0x04000,  
00153          endOfFreqRMSValid = 0x08000,  
00154          endOfAntennaValid = 0x10000,  
00155          allValid13        = 0x11C3F   
00156       };
00157 
00160       static const std::vector<std::string> SatelliteTypes;
00161 
00163       typedef std::map<double, double> zenOffsetMap;
00164 
00168       typedef std::map<double, zenOffsetMap> azimZenMap;
00169 
00173       class antennaPCOandPCVData {
00174       public:
00179          double PCOvalue[3],PCOrms[3];
00180 
00183          bool hasAzimuth;
00184 
00191          azimZenMap PCVvalue, PCVrms;
00192 
00193       }; // end of class antennaPCOandPCVData
00194 
00195       // member data
00197       unsigned long valid;
00198 
00200       bool absolute;
00201 
00206       bool isRxAntenna;
00207 
00211       int PRN, SVN;
00212 
00215       char systemChar;
00216 
00219       unsigned int nFreq;
00220 
00224       double azimDelta;
00225 
00228       double zenRange[3];
00229 
00235       DayTime validFrom,validUntil;
00236       std::string stringValidFrom, stringValidUntil;
00237 
00239       std::map<int, antennaPCOandPCVData> freqPCVmap;
00240 
00241       std::string type;     
00242       std::string serialNo; 
00243       std::string satCode;  
00244       std::string cospar;   
00245       std::string method;   
00246       std::string agency;   
00247       int noAntCalibrated;  
00248       std::string date;     
00249       std::string sinexCode;
00250 
00252       std::vector<std::string> commentList;  
00253 
00254       //------------------------------------------------------------------------------
00255       // member functions
00256 
00258       AntexData() : validFrom(DayTime::BEGINNING_OF_TIME),
00259                     validUntil(DayTime::END_OF_TIME),
00260                     valid(0), PRN(0), SVN(0), nFreq(0), absolute(true) {}
00261 
00263       virtual ~AntexData() {}
00264 
00266       virtual bool isData() const {return true;}
00267 
00269       bool isValid(void) const { return ((valid & allValid13) == allValid13); }
00270 
00277       bool isValid(DayTime& time) const throw();
00278 
00280       inline std::string name(void) const throw()
00281       {
00282          if(!isValid())
00283             return std::string("invaild");
00284          if(isRxAntenna)
00285             return (type);
00286          else
00287             return (type + std::string("/") + serialNo);
00288       }
00289 
00297       //         receivers, or nadir angle in degrees from Z axis for satellites
00302       double getTotalPhaseCenterOffset(const int freq,
00303                                        const double azimuth,
00304                                        const double elevation) const
00305          throw(Exception);
00306 
00316       Triple getPhaseCenterOffset(const int freq) const
00317          throw(Exception);
00318 
00325       //         receivers, or nadir angle in degrees from Z axis for satellites
00330       double getPhaseCenterVariation(const int freq,
00331                                      const double azimuth,
00332                                      const double elev_nadir) const
00333          throw(Exception);
00334 
00337       virtual void dump(std::ostream& s, int detail=0) const;
00338 
00339    protected:
00342       void evaluateZenithMap(const double& zen,
00343                              const zenOffsetMap& eomap,
00344                              double& zen_lo, double& zen_hi,
00345                              double& pco_lo, double& pco_hi) const throw();
00346 
00348       virtual void reallyPutRecord(FFStream& s) const 
00349          throw(std::exception, FFStreamError,
00350             StringUtils::StringException);
00351 
00359       virtual void reallyGetRecord(FFStream& s) 
00360          throw(std::exception, FFStreamError,
00361                StringUtils::StringException);
00362 
00363    private:
00366       void throwRecordOutOfOrder(unsigned long test, std::string& label);
00367 
00369       void ParseDataRecord(std::string& line)
00370          throw(FFStreamError);
00371 
00374       std::string writeTime(const DayTime& dt) const
00375          throw(StringUtils::StringException);
00376 
00380       DayTime parseTime(const std::string& line) const
00381          throw(FFStreamError);
00382 
00383    }; // class AntexData
00384 
00386 
00387 } // namespace
00388 
00389 #endif

Generated on Wed Feb 8 03:30:57 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1