TropModel.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: TropModel.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00020 //
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S.
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software.
00031 //
00032 //Pursuant to DoD Directive 523024
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00039 #ifndef TROPOSPHERIC_MODELS_GPSTK
00040 #define TROPOSPHERIC_MODELS_GPSTK
00041 
00048 #include "Exception.hpp"
00049 #include "ObsEpochMap.hpp"
00050 #include "WxObsMap.hpp"
00051 #include "Xvt.hpp"
00052 #include "Position.hpp"
00053 #include "Matrix.hpp"
00054 #include "GNSSconstants.hpp"
00055 
00056 
00057 // Model of the troposphere, used to compute non-dispersive delay of
00058 // satellite signal as function of satellite elevation as seen at the
00059 // receiver. Both wet and dry components are computed.
00060 //
00061 // The default model (implemented here) is a simple Black model.
00062 //
00063 // In this model (and many others), the wet and dry components are
00064 // independent, the zenith delays depend only on the weather
00065 // (temperature, pressure and humidity), and the mapping functions
00066 // depend only on the elevation of the satellite as seen at the
00067 // receiver. In general, this is not true; other models depend on,
00068 // for example, latitude or day of year.
00069 //
00070 // Other models may be implemented by inheriting this class and
00071 // redefining the virtual functions, and (perhaps) adding other
00072 // 'set...()' routines as needed.
00073 
00074 namespace gpstk
00075 {
00078 
00093    class TropModel
00094    {
00095    public:
00099       NEW_EXCEPTION_CLASS(InvalidTropModel, gpstk::Exception);
00100 
00102       virtual ~TropModel() {}
00103 
00105       bool isValid(void)
00106          { return valid; }
00107 
00110       virtual double correction(double elevation) const
00111          throw(InvalidTropModel);
00112 
00124       virtual double correction(const Position& RX,
00125                                 const Position& SV,
00126                                 const CommonTime& tt)
00127          throw(InvalidTropModel);
00128 
00140       virtual double correction(const Xvt& RX,
00141                                 const Xvt& SV,
00142                                 const CommonTime& tt)
00143          throw(InvalidTropModel)
00144       { Position R(RX),S(SV);  return TropModel::correction(R,S,tt); }
00145 
00147       virtual double dry_zenith_delay(void) const
00148          throw(InvalidTropModel) = 0;
00149 
00151       virtual double wet_zenith_delay(void) const
00152          throw(InvalidTropModel) = 0;
00153 
00157       virtual double dry_mapping_function(double elevation)
00158          const throw(InvalidTropModel) = 0;
00159 
00163       virtual double wet_mapping_function(double elevation)
00164          const throw(InvalidTropModel) = 0;
00165 
00171       virtual void setWeather(const double& T,
00172                               const double& P,
00173                               const double& H)
00174          throw(InvalidParameter);
00175 
00179       virtual void setWeather(const WxObservation& wx)
00180          throw(InvalidParameter);
00181 
00185       virtual void setReceiverHeight(const double& ht) {};
00186 
00191       virtual void setReceiverLatitude(const double& lat) {};
00192 
00196       virtual void setDayOfYear(const int& d) {};
00197 
00204       static void weatherByStandardAtmosphereModel(const double& ht, double& T, double& P, double& H);
00205 
00206    protected:
00207       bool valid;                 // true only if current model parameters are valid
00208       double temp;                // latest value of temperature (kelvin or celsius)
00209       double press;               // latest value of pressure (millibars)
00210       double humid;               // latest value of relative humidity (percent)
00211 
00212    }; // end class TropModel
00213 
00214 
00215    //---------------------------------------------------------------------------------
00217    class ZeroTropModel : public TropModel
00218    {
00219    public:
00222       virtual double correction(double elevation) const
00223          throw(InvalidTropModel)
00224          { return 0.0; }
00225 
00237       virtual double correction(const Position& RX,
00238                                 const Position& SV,
00239                                 const CommonTime& tt)
00240          throw(InvalidTropModel)
00241          { return 0.0; }
00242 
00254       virtual double correction(const Xvt& RX,
00255                                 const Xvt& SV,
00256                                 const CommonTime& tt)
00257          throw(InvalidTropModel)
00258          { return 0.0; }
00259 
00261       virtual double dry_zenith_delay(void) const
00262          throw(InvalidTropModel)
00263          { return 0.0; }
00264 
00266       virtual double wet_zenith_delay(void) const
00267          throw(InvalidTropModel)
00268          { return 0.0; }
00269 
00273       virtual double dry_mapping_function(double elevation)
00274          const throw(InvalidTropModel)
00275          { return 0.0; }
00276 
00280       virtual double wet_mapping_function(double elevation)
00281          const throw(InvalidTropModel)
00282          { return 0.0; }
00283 
00284    }; // end class ZeroTropModel
00285 
00286 
00287    //---------------------------------------------------------------------------------
00289    class SimpleTropModel : public TropModel
00290    {
00291    public:
00293       SimpleTropModel(void);
00294 
00297       SimpleTropModel(const WxObservation& wx)
00298          throw(InvalidParameter);
00299 
00304       SimpleTropModel(const double& T,
00305                       const double& P,
00306                       const double& H)
00307          throw(InvalidParameter);
00308 
00310       virtual double dry_zenith_delay(void) const
00311          throw(InvalidTropModel);
00312 
00314       virtual double wet_zenith_delay(void) const
00315          throw(InvalidTropModel);
00316 
00320       virtual double dry_mapping_function(double elevation) const
00321          throw(InvalidTropModel);
00322 
00326       virtual double wet_mapping_function(double elevation) const
00327          throw(InvalidTropModel);
00328 
00334       virtual void setWeather(const double& T,
00335                               const double& P,
00336                               const double& H)
00337          throw(InvalidParameter);
00338 
00342       virtual void setWeather(const WxObservation& wx)
00343          throw(InvalidParameter);
00344 
00345    private:
00346       double Cdrydelay;
00347       double Cwetdelay;
00348       double Cdrymap;
00349       double Cwetmap;
00350 
00351    };    // end class SimpleTropModel
00352 
00353    //---------------------------------------------------------------------------------
00360    class GGTropModel : public TropModel
00361    {
00362    public:
00364       GGTropModel(void);
00365 
00368       GGTropModel(const WxObservation& wx)
00369          throw(InvalidParameter);
00370 
00375       GGTropModel(const double& T,
00376                   const double& P,
00377                   const double& H)
00378          throw(InvalidParameter);
00379 
00382       virtual double dry_zenith_delay(void) const
00383          throw(InvalidTropModel);
00384 
00387       virtual double wet_zenith_delay(void) const
00388          throw(InvalidTropModel);
00389 
00393       virtual double dry_mapping_function(double elevation) const
00394          throw(InvalidTropModel);
00395 
00399       virtual double wet_mapping_function(double elevation) const
00400          throw(InvalidTropModel);
00401 
00407       virtual void setWeather(const double& T,
00408                               const double& P,
00409                               const double& H)
00410          throw(InvalidParameter);
00411 
00415       virtual void setWeather(const WxObservation& wx)
00416          throw(InvalidParameter);
00417 
00418    private:
00419       double Cdrydelay;
00420       double Cwetdelay;
00421       double Cdrymap;
00422       double Cwetmap;
00423 
00424    };    // end class GGTropModel
00425 
00426    //---------------------------------------------------------------------------------
00456    class GGHeightTropModel : public TropModel
00457    {
00458    public:
00460       GGHeightTropModel(void);
00461 
00464       GGHeightTropModel(const WxObservation& wx)
00465          throw(InvalidParameter);
00466 
00471       GGHeightTropModel(const double& T,
00472                         const double& P,
00473                         const double& H)
00474          throw(InvalidParameter);
00475 
00483       GGHeightTropModel(const double& T,
00484                         const double& P,
00485                         const double& H,
00486                         const double hT,
00487                         const double hP,
00488                         const double hH)
00489          throw(InvalidParameter);
00490 
00493       virtual double correction(double elevation) const
00494          throw(InvalidTropModel);
00495 
00507       virtual double correction(const Position& RX,
00508                                 const Position& SV,
00509                                 const CommonTime& tt)
00510          throw(InvalidTropModel);
00511 
00523       virtual double correction(const Xvt& RX,
00524                                 const Xvt& SV,
00525                                 const CommonTime& tt)
00526          throw(InvalidTropModel);
00527 
00530       virtual double dry_zenith_delay(void) const
00531          throw(InvalidTropModel);
00532 
00534       virtual double wet_zenith_delay(void) const
00535          throw(InvalidTropModel);
00536 
00540       virtual double dry_mapping_function(double elevation) const
00541          throw(InvalidTropModel);
00542 
00546       virtual double wet_mapping_function(double elevation) const
00547          throw(InvalidTropModel);
00548 
00554       virtual void setWeather(const double& T,
00555                               const double& P,
00556                               const double& H)
00557          throw(InvalidParameter);
00558 
00562       virtual void setWeather(const WxObservation& wx)
00563          throw(InvalidParameter);
00564 
00570       void setHeights(const double& hT,
00571                       const double& hP,
00572                       const double& hH);
00573 
00576       void setReceiverHeight(const double& ht);
00577 
00578    private:
00579       double height;                // height (m) of the receiver
00580       double htemp;                 // height (m) at which temp applies
00581       double hpress;                // height (m) at which press applies
00582       double hhumid;                // height (m) at which humid applies
00583       bool validWeather;
00584       bool validHeights;
00585       bool validRxHeight;
00586 
00587    };    // end class GGHeightTropModel
00588 
00589 
00590    //---------------------------------------------------------------------------------
00626    class NBTropModel : public TropModel
00627    {
00628    public:
00630       NBTropModel(void);
00631 
00636       NBTropModel(const double& lat,
00637                   const int& day);
00638 
00643       NBTropModel(const double& lat,
00644                   const int& day,
00645                   const WxObservation& wx)
00646          throw(InvalidParameter);
00647 
00654       NBTropModel(const double& lat,
00655                   const int& day,
00656                   const double& T,
00657                   const double& P,
00658                   const double& H)
00659          throw(InvalidParameter);
00660 
00666       NBTropModel(const double& ht,
00667                   const double& lat,
00668                   const int& day);
00669 
00672       virtual double correction(double elevation) const
00673          throw(InvalidTropModel);
00674 
00686       virtual double correction(const Position& RX,
00687                                 const Position& SV,
00688                                 const CommonTime& tt)
00689          throw(InvalidTropModel);
00690 
00702       virtual double correction(const Xvt& RX,
00703                                 const Xvt& SV,
00704                                 const CommonTime& tt)
00705          throw(InvalidTropModel);
00706 
00709       virtual double dry_zenith_delay(void) const
00710          throw(InvalidTropModel);
00711 
00714       virtual double wet_zenith_delay(void) const
00715          throw(InvalidTropModel);
00716 
00720       virtual double dry_mapping_function(double elevation) const
00721          throw(InvalidTropModel);
00722 
00726       virtual double wet_mapping_function(double elevation) const
00727          throw(InvalidTropModel);
00728 
00732       virtual void setWeather(const WxObservation& wx)
00733          throw(InvalidParameter);
00734 
00739       virtual void setWeather(const double& T,
00740                               const double& P,
00741                               const double& H)
00742          throw(InvalidParameter);
00743 
00745       void setWeather()
00746          throw(InvalidTropModel);
00747 
00751       void setReceiverHeight(const double& ht);
00752 
00756       void setReceiverLatitude(const double& lat);
00757 
00761       void setDayOfYear(const int& d);
00762 
00763    private:
00764       bool interpolateWeather;      // if true, compute T,P,H from latitude,doy
00765       double height;                // height (m) of the receiver
00766       double latitude;              // latitude (deg) of receiver
00767       int doy;                      // day of year
00768       bool validWeather;
00769       bool validRxLatitude;
00770       bool validRxHeight;
00771       bool validDOY;
00772 
00773    };    // end class NBTropModel
00774 
00775    //---------------------------------------------------------------------------------
00801    class SaasTropModel : public TropModel
00802    {
00803    public:
00805       SaasTropModel(void);
00806 
00810       SaasTropModel(const double& lat,
00811                     const int& day);
00812 
00817       SaasTropModel(const double& lat,
00818                     const int& day,
00819                     const WxObservation& wx)
00820          throw(InvalidParameter);
00821 
00828       SaasTropModel(const double& lat,
00829                     const int& day,
00830                     const double& T,
00831                     const double& P,
00832                     const double& H)
00833          throw(InvalidParameter);
00834 
00837       virtual double correction(double elevation) const
00838          throw(InvalidTropModel);
00839 
00851       virtual double correction(const Position& RX,
00852                                 const Position& SV,
00853                                 const CommonTime& tt)
00854          throw(InvalidTropModel);
00855 
00867       virtual double correction(const Xvt& RX,
00868                                 const Xvt& SV,
00869                                 const CommonTime& tt)
00870          throw(InvalidTropModel);
00871 
00874       virtual double dry_zenith_delay(void) const
00875          throw(InvalidTropModel);
00876 
00879       virtual double wet_zenith_delay(void) const
00880          throw(InvalidTropModel);
00881 
00885       virtual double dry_mapping_function(double elevation) const
00886          throw(InvalidTropModel);
00887 
00891       virtual double wet_mapping_function(double elevation) const
00892          throw(InvalidTropModel);
00893 
00897       virtual void setWeather(const WxObservation& wx)
00898          throw(InvalidParameter);
00899 
00904       virtual void setWeather(const double& T,
00905                               const double& P,
00906                               const double& H)
00907          throw(InvalidParameter);
00908 
00912       void setReceiverHeight(const double& ht);
00913 
00917       void setReceiverLatitude(const double& lat);
00918 
00922       void setDayOfYear(const int& d);
00923 
00924    private:
00925       double height;                
00926       double latitude;              
00927       int doy;                      
00928       bool validWeather;
00929       bool validRxLatitude;
00930       bool validRxHeight;
00931       bool validDOY;
00932 
00933    };    // end class SaasTropModel
00934 
00935 
00936       //--------------------------------------------------------------------
00937 
00976    class GCATTropModel : public TropModel
00977    {
00978    public:
00979 
00980 
00982       GCATTropModel(void)
00983       { valid = false; };
00984 
00985 
00991       GCATTropModel(const double& ht);
00992 
00993 
01001       virtual double correction(double elevation) const
01002          throw(InvalidTropModel);
01003 
01004 
01015       virtual double correction( const Position& RX,
01016                                  const Position& SV )
01017          throw(InvalidTropModel);
01018 
01019 
01032       virtual double correction( const Position& RX,
01033                                  const Position& SV,
01034                                  const CommonTime& tt )
01035          throw(InvalidTropModel)
01036       { return correction(RX, SV); };
01037 
01038 
01053       virtual double correction( const Xvt& RX,
01054                                  const Xvt& SV,
01055                                  const CommonTime& tt )
01056          throw(InvalidTropModel);
01057 
01058 
01062       virtual double dry_zenith_delay(void) const
01063          throw(InvalidTropModel);
01064 
01065 
01069       virtual double wet_zenith_delay(void) const
01070          throw(InvalidTropModel)
01071       { return 0.1; };
01072 
01073 
01080       virtual double mapping_function(double elevation) const
01081          throw(InvalidTropModel);
01082 
01083 
01089       virtual double dry_mapping_function(double elevation) const
01090          throw(InvalidTropModel)
01091       { return mapping_function(elevation); };
01092 
01093 
01100       virtual double wet_mapping_function(double elevation) const
01101          throw(InvalidTropModel)
01102       { return mapping_function(elevation); };
01103 
01104 
01108       virtual void setWeather( const double& T,
01109                                const double& P,
01110                                const double& H )
01111          throw(InvalidParameter) {};
01112 
01113 
01117       virtual void setWeather(const WxObservation& wx)
01118          throw(InvalidParameter) {};
01119 
01120 
01126       virtual void setReceiverHeight(const double& ht);
01127 
01128 
01129    private:
01130 
01132       double gcatHeight;
01133 
01134    };    // end class GCATTropModel
01135 
01136 
01137       //---------------------------------------------------------------------
01138 
01173    class MOPSTropModel : public GCATTropModel
01174    {
01175    public:
01176 
01178       MOPSTropModel(void);
01179 
01180 
01188       MOPSTropModel(const double& ht)
01189       { setReceiverHeight(ht); };
01190 
01191 
01200       MOPSTropModel(const double& ht, const double& lat, const int& doy);
01201 
01202 
01209       MOPSTropModel(const Position& RX, const CommonTime& time);
01210 
01211 
01219       virtual double correction(double elevation) const
01220          throw(InvalidTropModel);
01221 
01222 
01235       virtual double correction( const Position& RX,
01236                                  const Position& SV )
01237          throw(InvalidTropModel);
01238 
01239 
01252       virtual double correction( const Position& RX,
01253                                  const Position& SV,
01254                                  const CommonTime& tt )
01255          throw(InvalidTropModel);
01256 
01257 
01270       virtual double correction( const Position& RX,
01271                                  const Position& SV,
01272                                  const int& doy )
01273          throw(InvalidTropModel);
01274 
01275 
01286       virtual double correction( const Xvt& RX,
01287                                  const Xvt& SV )
01288          throw(InvalidTropModel);
01289 
01290 
01305       virtual double correction( const Xvt& RX,
01306                                  const Xvt& SV,
01307                                  const CommonTime& tt )
01308          throw(InvalidTropModel);
01309 
01310 
01325       virtual double correction( const Xvt& RX,
01326                                  const Xvt& SV,
01327                                  const int& doy )
01328          throw(InvalidTropModel);
01329 
01330 
01333       virtual double dry_zenith_delay(void) const
01334          throw(InvalidTropModel);
01335 
01336 
01339       virtual double wet_zenith_delay(void) const
01340          throw(InvalidTropModel);
01341 
01342 
01347       void setWeather()
01348          throw(InvalidTropModel);
01349 
01350 
01353       virtual void setWeather( const double& T,
01354                                const double& P,
01355                                const double& H )
01356          throw(InvalidParameter) {};
01357 
01358 
01361       virtual void setWeather(const WxObservation& wx)
01362          throw(InvalidParameter) {};
01363 
01364 
01370       virtual void setReceiverHeight(const double& ht);
01371 
01372 
01378       virtual void setReceiverLatitude(const double& lat);
01379 
01380 
01386       virtual void setDayOfYear(const int& doy);
01387 
01388 
01394       virtual void setDayOfYear(const CommonTime& time);
01395 
01396 
01402       virtual void setAllParameters( const CommonTime& time,
01403                                      const Position& rxPos );
01404 
01405 
01412       double MOPSsigma2(double elevation)
01413          throw(TropModel::InvalidTropModel);
01414 
01415 
01416    private:
01417 
01418       double MOPSHeight;
01419       double MOPSLat;
01420       int MOPSTime;
01421       bool validHeight;
01422       bool validLat;
01423       bool validTime;
01424       Matrix<double> avr;
01425       Matrix<double> svr;
01426       Vector<double> fi0;
01427       Vector<double> MOPSParameters;
01428 
01429 
01430          // The MOPS tropospheric model needs to compute several extra
01431          // parameters
01432       virtual void prepareParameters(void) throw(TropModel::InvalidTropModel);
01433 
01434 
01435          // The MOPS tropospheric model uses several predefined data tables
01436       virtual void prepareTables(void);
01437 
01438    };    // end class MOPSTropModel
01439 
01440 
01441       //--------------------------------------------------------------------
01442 
01481    class NeillTropModel : public TropModel
01482    {
01483    public:
01484 
01486       NeillTropModel(void)
01487       { validHeight=false; validLat=false; validDOY=false; valid=false; };
01488 
01489 
01497       NeillTropModel(const double& ht)
01498       { setReceiverHeight(ht); };
01499 
01500 
01509       NeillTropModel( const double& ht,
01510                       const double& lat,
01511                       const int& doy )
01512       { setReceiverHeight(ht); setReceiverLatitude(lat); setDayOfYear(doy); };
01513 
01514 
01520       NeillTropModel( const Position& RX,
01521                       const CommonTime& time );
01522 
01523 
01530       virtual double correction(double elevation) const
01531          throw(InvalidTropModel);
01532 
01533 
01548       virtual double correction( const Position& RX,
01549                                  const Position& SV )
01550          throw(InvalidTropModel);
01551 
01552 
01565       virtual double correction( const Position& RX,
01566                                  const Position& SV,
01567                                  const CommonTime& tt )
01568         throw(InvalidTropModel);
01569 
01570 
01583       virtual double correction( const Position& RX,
01584                                  const Position& SV,
01585                                  const int& doy )
01586          throw(InvalidTropModel);
01587 
01588 
01599       virtual double correction( const Xvt& RX,
01600                                  const Xvt& SV  )
01601          throw(InvalidTropModel);
01602 
01603 
01618       virtual double correction( const Xvt& RX,
01619                                  const Xvt& SV,
01620                                  const CommonTime& tt )
01621          throw(InvalidTropModel);
01622 
01623 
01638       virtual double correction( const Xvt& RX,
01639                                  const Xvt& SV,
01640                                  const int& doy )
01641          throw(InvalidTropModel);
01642 
01643 
01646       virtual double dry_zenith_delay(void) const
01647          throw(InvalidTropModel);
01648 
01649 
01652       virtual double wet_zenith_delay(void) const
01653          throw(InvalidTropModel)
01654       { return 0.1; };           // Returns a nominal value
01655 
01656 
01662       virtual double dry_mapping_function(double elevation) const
01663          throw(InvalidTropModel);
01664 
01665 
01671       virtual double wet_mapping_function(double elevation) const
01672          throw(InvalidTropModel);
01673 
01674 
01678       void setWeather()
01679          throw(InvalidTropModel);
01680 
01681 
01684       virtual void setWeather( const double& T,
01685                                const double& P,
01686                                const double& H )
01687          throw(InvalidParameter) {};
01688 
01689 
01692       virtual void setWeather(const WxObservation& wx)
01693          throw(InvalidParameter) {};
01694 
01695 
01701       virtual void setReceiverHeight(const double& ht);
01702 
01703 
01708       virtual void setReceiverLatitude(const double& lat);
01709 
01710 
01715       virtual void setDayOfYear(const int& doy);
01716 
01717 
01722       virtual void setDayOfYear(const CommonTime& time);
01723 
01724 
01730       virtual void setAllParameters( const CommonTime& time,
01731                                      const Position& rxPos );
01732 
01733 
01734    private:
01735 
01736 
01737       double NeillHeight;
01738       double NeillLat;
01739       int NeillDOY;
01740       bool validHeight;
01741       bool validLat;
01742       bool validDOY;
01743 
01744 
01745    };    // end class NeillTropModel
01746 
01748 
01749 }
01750 #endif   // TROPOSPHERIC_MODELS_GPSTK

Generated on Sat May 18 03:31:12 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1