Main Page | User's Guide | Namespace List | Class List | File List | Namespace Members | Class Members

CoordTransform.hxx

00001 // Copyright (C) 2003-2005 CEREA
00002 //     Author: Vivien Mallet
00003 //
00004 // CEREA (http://www.enpc.fr/cerea) is a joint laboratory of
00005 // ENPC (http://www.enpc.fr) and EDF R&D (http://www.edf.fr).
00006 //
00007 // This file is part of AtmoData library.
00008 // AtmoData library is a tool for data processing in atmospheric
00009 // sciences.
00010 // 
00011 // AtmoData is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU General Public License as published by
00013 // the Free Software Foundation; either version 2 of the License, or
00014 // (at your option) any later version.
00015 // 
00016 // AtmoData is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU General Public License (file "license") for more details.
00020 //
00021 // For more information, please see the AtmoData home page:
00022 //     http://spacetown.free.fr/lib/atmodata
00023 
00024 
00025 #ifndef ATMODATA_FILE_COORDTRANSFORM_HXX
00026 
00027 #include <cmath>
00028 
00029 namespace AtmoData
00030 {
00031   
00034   template<class T>
00035   class LaeaToLonlat
00036   {
00037   protected:
00039     const T Earth_radius_;
00041     const T pi_;
00043     const T limit_;
00044 
00046     T lat_origin_;
00048     T lon_origin_;
00049 
00050   public:
00051     LaeaToLonlat(T lon_origin, T lat_origin)  throw();
00052     void operator() (const T x, const T y,
00053                      T& lon, T& lat);
00054   };
00055 
00056 
00059   template<class T>
00060   class MM5LccIndToLonlat
00061   {
00062   protected:
00064     const int jmx_;
00066     const int imx_;
00068     const double jx_;
00070     const double ix_;
00072     const double phic_;
00074     const double lambdac_;
00076     const double phi1_;
00078     const double phi2_;
00080     const double ds_;
00082     const int ratio_;
00084     const double Earth_radius_;
00086     const double pi_;
00087 
00088   public:
00089     MM5LccIndToLonlat(int jmx, int imx, double jx, double ix,
00090                       double phic, double lambdac,
00091                       double phi1, double phi2, double ds,
00092                       int ratio)  throw();
00093     void operator() (const T j, const T i,
00094                      T& lon, T& lat);
00095   };
00096 
00097 
00100   template<class T>
00101   class LonlatToMM5LccInd
00102   {
00103   protected:
00105     const int jmx_;
00107     const int imx_;
00109     const double jx_;
00111     const double ix_;
00113     const double phic_;
00115     const double lambdac_;
00117     const double phi1_;
00119     const double phi2_;
00121     const double ds0_;
00123     const int ratio_;
00125     const double Earth_radius_;
00127     const double pi_;
00128 
00129   public:
00130     LonlatToMM5LccInd(int jmx, int imx, double jx, double ix,
00131                       double phic, double lambdac,
00132                       double phi1, double phi2, double ds0,
00133                       int ratio)  throw();
00134     void operator() (const T lon, const T lat,
00135                      T& j, T& i);
00136   };
00137 
00138 
00141   template<class T>
00142   class MM5MercIndToLonlat
00143   {
00144   protected:
00146     const int jmx_;
00148     const int imx_;
00150     const double jx_;
00152     const double ix_;
00154     const double phic_;
00156     const double lambdac_;
00158     const double phi1_;
00160     const double ds_;
00162     const int ratio_;
00164     const double Earth_radius_;
00166     const double pi_;
00167 
00168   public:
00169     MM5MercIndToLonlat(int jmx, int imx, double jx, double ix,
00170                        double phic, double lambdac,
00171                        double phi1, double ds, int ratio)  throw();
00172     void operator() (const T j, const T i,
00173                      T& lon, T& lat);
00174   };
00175 
00176 
00179   template<class T>
00180   class LonlatToMM5MercInd
00181   {
00182   protected:
00184     const int jmx_;
00186     const int imx_;
00188     const double jx_;
00190     const double ix_;
00192     const double phic_;
00194     const double lambdac_;
00196     const double phi1_;
00198     const double ds0_;
00200     const int ratio_;
00202     const double Earth_radius_;
00204     const double pi_;
00205 
00206   public:
00207     LonlatToMM5MercInd(int jmx, int imx, double jx, double ix,
00208                        double phic, double lambdac,
00209                        double phi1, double ds0, int ratio)  throw();
00210     void operator() (const T lon, const T lat,
00211                      T& j, T& i);
00212   };
00213 
00214 
00217   template<class T>
00218   class MM5StereIndToLonlat
00219   {
00220   protected:
00222     const int jmx_;
00224     const int imx_;
00226     const double jx_;
00228     const double ix_;
00230     const double phic_;
00232     const double lambdac_;
00234     const double phi1_;
00236     const double ds_;
00238     const int ratio_;
00240     const double Earth_radius_;
00242     const double pi_;
00243 
00244   public:
00245     MM5StereIndToLonlat(int jmx, int imx, double jx, double ix,
00246                         double phic, double lambdac,
00247                         double phi1, double ds, int ratio)  throw();
00248     void operator() (const T j, const T i,
00249                      T& lon, T& lat);
00250   };
00251 
00252 
00255   template<class T>
00256   class LonlatToMM5StereInd
00257   {
00258   protected:
00260     const int jmx_;
00262     const int imx_;
00264     const double jx_;
00266     const double ix_;
00268     const double phic_;
00270     const double lambdac_;
00272     const double phi1_;
00274     const double ds0_;
00276     const int ratio_;
00278     const double Earth_radius_;
00280     const double pi_;
00281 
00282   public:
00283     LonlatToMM5StereInd(int jmx, int imx, double jx, double ix,
00284                         double phic, double lambdac,
00285                         double phi1, double ds0, int ratio)  throw();
00286     void operator() (const T lon, const T lat,
00287                      T& j, T& i);
00288   };
00289 
00290 
00291 }  // namespace AtmoData.
00292 
00293 #define ATMODATA_FILE_COORDTRANSFORM_HXX
00294 #endif

Generated on Tue Nov 7 14:58:48 2006 for AtmoData by  doxygen 1.4.2