MI - Fimex
FeltGridDefinition.h
Go to the documentation of this file.
1 /*
2  wdb
3 
4  Copyright (C) 2007 met.no
5 
6  Contact information:
7  Norwegian Meteorological Institute
8  Box 43 Blindern
9  0313 OSLO
10  NORWAY
11  E-mail: wdb@met.no
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26  MA 02110-1301, USA
27  */
28 
29 #ifndef FELTGRIDDEFINITION_H_
30 #define FELTGRIDDEFINITION_H_
31 
32 #include <string>
33 #include <vector>
34 #include <iosfwd>
35 #include <boost/array.hpp>
36 
37 namespace felt
38 {
39 
51 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);
52 
59 std::string gridParametersToProjDefinition(int gridType, const boost::array<float, 6>& gridPars);
60 
61 
63 {
64 public:
73  enum Orientation {
74  LeftUpperHorizontal = 0, // 00000000
75  LeftLowerHorizontal = 64 // 01000000
76  };
81  FeltGridDefinition(int gridType, int xNum, int yNum, int a, int b, int c, int d, const std::vector<short int> & extraData);
82  virtual ~FeltGridDefinition();
83  virtual std::string projDefinition() const;
84  virtual int getXNumber() const;
85  virtual int getYNumber() const;
89  virtual float getXIncrement() const;
93  virtual float getYIncrement() const;
94  virtual float startLongitude() const;
95  virtual float startLatitude() const;
99  virtual float startX() const;
103  virtual float startY() const;
104  virtual const boost::array<float, 6>& getGridParameters() const;
105  Orientation getScanMode() const;
106 
107 
108 private:
109  const int gridType_;
110  const size_t xNum_;
111  const size_t yNum_;
112  float startX_;
113  float startY_;
114  float incrementX_;
115  float incrementY_;
116  Orientation orientation_;
117  boost::array<float, 6> gridPars_;
118 
119  Orientation getScanMode_();
120  void polarStereographicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
121  void geographicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
122  void mercatorProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
123  void lambertConicProj_(int gridType, int a, int b, int c, int d, const std::vector<short int> & extraData);
124  // those two below are deprecated
125  void polarStereographicProj(int gridType, float poleX, float poleY, float gridD, float rot, const std::vector<short int> & extraData);
126  void geographicProj(int gridType, float startLongitude, float startLatitude, float iInc, float jInc, const std::vector<short int> & extraData);
127 
128 };
129 
131 
132 }
133 
134 #endif /*FELTGRIDDEFINITION_H_*/
virtual float startLatitude() const
virtual float startX() const
virtual const boost::array< float, 6 > & getGridParameters() const
Definition: FeltConstants.h:35
basic_string< char > string
virtual float startLongitude() const
virtual float getYIncrement() const
basic_ostream< char > ostream
Orientation
Definition: FeltGridDefinition.h:73
STL class.
virtual float startY() const
std::string gridParametersToProjDefinition(int gridType, const boost::array< float, 6 > &gridPars)
FeltGridDefinition(int gridType, int xNum, int yNum, int a, int b, int c, int d, const std::vector< short int > &extraData)
virtual std::string projDefinition() const
virtual int getXNumber() const
Definition: FeltGridDefinition.h:62
Definition: FeltGridDefinition.h:75
Definition: FeltGridDefinition.h:74
virtual float getXIncrement() const
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)
std::ostream & contentSummary(std::ostream &out, const FeltGridDefinition &grid)
virtual int getYNumber() const
Orientation getScanMode() const