MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ResamplingAlgorithms2D.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2011 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef RESAMPLINGALGORITHMS2D_H
19 #define RESAMPLINGALGORITHMS2D_H
20 
21 #include <meteoio/dataClasses/Grid2DObject.h> //this contains Array2D
22 
23 #include <iostream>
24 #include <string>
25 
26 namespace mio {
27 
37  public:
38  //Available algorithms
39  static const Grid2DObject NearestNeighbour(const Grid2DObject &i_grid, const double &factor);
40  static const Grid2DObject BilinearResampling(const Grid2DObject &i_grid, const double &factor);
41  static const Grid2DObject cubicBSplineResampling(const Grid2DObject &i_grid, const double &factor);
42 
43  static const Array2D<double> NearestNeighbour(const Array2D<double> &i_grid, const double &factor_x, const double &factor_y);
44  static const Array2D<double> BilinearResampling(const Array2D<double> &i_grid, const double &factor_x, const double &factor_y);
45  static const Array2D<double> cubicBSplineResampling(const Array2D<double> &i_grid, const double &factor_x, const double &factor_y);
46 
47  private:
48  static void cubicBSpline(Array2D<double> &o_grid, const Array2D<double> &i_grid);
49  static void Bilinear(Array2D<double> &o_grid, const Array2D<double> &i_grid);
50  static void NearestNeighbour(Array2D<double> &o_grid, const Array2D<double> &i_grid);
51 
52  static double bilinear_pixel(const Array2D<double> &i_grid, const size_t &org_ii, const size_t &org_jj, const size_t &org_ncols, const size_t &org_nrows, const double &x, const double &y);
53  static double BSpline_weight(const double &x);
54 };
55 } //end namespace
56 
57 #endif
static const Grid2DObject BilinearResampling(const Grid2DObject &i_grid, const double &factor)
Bilinear spatial data resampling.
Definition: ResamplingAlgorithms2D.cc:48
static const Grid2DObject cubicBSplineResampling(const Grid2DObject &i_grid, const double &factor)
Definition: ResamplingAlgorithms2D.cc:64
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:37
Spatial resampling algorithms.
Definition: ResamplingAlgorithms2D.h:36
static const Grid2DObject NearestNeighbour(const Grid2DObject &i_grid, const double &factor)
Definition: ResamplingAlgorithms2D.cc:29