# MI - Fimex: include/felt/FeltGridDefinition.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

# include/felt/FeltGridDefinition.h

Go to the documentation of this file.

    00001 /*
    00002  wdb
    00003
    00004  Copyright (C) 2007 met.no
    00005
    00006  Contact information:
    00007  Norwegian Meteorological Institute
    00008  Box 43 Blindern
    00009  0313 OSLO
    00010  NORWAY
    00011  E-mail: wdb@met.no
    00012
    00013  This program is free software; you can redistribute it and/or modify
    00014  it under the terms of the GNU General Public License as published by
    00015  the Free Software Foundation; either version 2 of the License, or
    00016  (at your option) any later version.
    00017
    00018  This program is distributed in the hope that it will be useful,
    00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00021  GNU General Public License for more details.
    00022
    00023  You should have received a copy of the GNU General Public License
    00024  along with this program; if not, write to the Free Software
    00025  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    00026  MA  02110-1301, USA
    00027  */
    00028
    00029 #ifndef FELTGRIDDEFINITION_H_
    00030 #define FELTGRIDDEFINITION_H_
    00031
    00032 #include <string>
    00033 #include <vector>
    00034 #include <iosfwd>
    00035 #include <boost/array.hpp>
    00036
    00037 namespace felt
    00038 {
    00039
    00051 boost::array<float, 6> gridParameters(int gridType, int xNum, int yNum, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00052
    00059 std::string gridParametersToProjDefinition(int gridType, const boost::array<float, 6>& gridPars);
    00060
    00061
    00062 class FeltGridDefinition
    00063 {
    00064 public:
    00073     enum Orientation {
    00074         LeftUpperHorizontal = 0,  // 00000000
    00075         LeftLowerHorizontal = 64  // 01000000
    00076     };
    00081     FeltGridDefinition(int gridType, int xNum, int yNum, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00082     virtual ~FeltGridDefinition();
    00083     virtual std::string projDefinition() const;
    00084     virtual int getXNumber() const;
    00085     virtual int getYNumber() const;
    00086     virtual float getXIncrement() const;
    00087     virtual float getYIncrement() const;
    00088     virtual float startLongitude() const;
    00089     virtual float startLatitude() const;
    00090     virtual float startX() const;
    00091     virtual float startY() const;
    00092     virtual const boost::array<float, 6>& getGridParameters() const;
    00093     Orientation getScanMode() const;
    00094
    00095
    00096 private:
    00097     const int gridType_;
    00098     const size_t xNum_;
    00099     const size_t yNum_;
    00100     float startX_;
    00101     float startY_;
    00102     float incrementX_;
    00103     float incrementY_;
    00104     Orientation orientation_;
    00105     boost::array<float, 6> gridPars_;
    00106
    00107     Orientation getScanMode_();
    00108     void polarStereographicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00109     void geographicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00110     void mercatorProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00111     void lambertConicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
    00112     // those two below are deprecated
    00113     void polarStereographicProj(int gridType, float poleX, float poleY, float gridD, float rot, const std::vector<short int> & extraData);
    00114     void geographicProj(int gridType, float startLongitude, float startLatitude, float iInc, float jInc, const std::vector<short int> & extraData);
    00115
    00116 };
    00117
    00118 std::ostream & contentSummary(std::ostream & out, const FeltGridDefinition & grid);
    00119
    00120 }
    00121
    00122 #endif /*FELTGRIDDEFINITION_H_*/