MeteoIODoc  2.10.0
Grid1DInterpolator.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 /***********************************************************************************/
3 /* Copyright 2021 MobyGIS Srl, Trento, Italy */
4 /***********************************************************************************/
5 /* This file is part of MeteoIO.
6  MeteoIO is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  MeteoIO is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef GRID1DINTERPOLATOR_H
21 #define GRID1DINTERPOLATOR_H
22 
25 #include <meteoio/Config.h>
27 
28 #include <string>
29 #include <vector>
30 #include <map>
31 
32 namespace mio {
33 
41  public:
42  Grid1DInterpolator(const Config& in_cfg);
43  Grid1DInterpolator(const Grid1DInterpolator& org) = default;
46  bool resampleData(const Date& date, const MeteoGrids::Parameters& parameter, const std::map<Date, Grid2DObject>& available_grids, Grid2DObject& resampled_grid);
47  double getWindowSize() const { return grid_window_size; }
48 
49  private:
50  std::string getGridAlgorithmForParameter(const std::string& parname) const;
51 
52  static const std::string section_name;
53  std::map<std::string, GridResamplingAlgorithm*> algorithm_map; //per parameter interpolation algorithms
54  const Config& cfg;
55  double grid_window_size = 86400.;
56  bool enable_grid_resampling = true;
57 };
58 
59 } //end namespace
60 
61 #endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
A class to temporally resample grid objects.
Definition: Grid1DInterpolator.h:40
Grid1DInterpolator(const Grid1DInterpolator &org)=default
double getWindowSize() const
Definition: Grid1DInterpolator.h:47
Grid1DInterpolator(const Config &in_cfg)
Constructor for a grid interpolator.
Definition: Grid1DInterpolator.cc:37
Grid1DInterpolator & operator=(const Grid1DInterpolator &)
~Grid1DInterpolator()
Destructor for a Grid1DInterpolator instance.
Definition: Grid1DInterpolator.cc:73
bool resampleData(const Date &date, const MeteoGrids::Parameters &parameter, const std::map< Date, Grid2DObject > &available_grids, Grid2DObject &resampled_grid)
Wrapper function to call the desired grid resampling algorithm.
Definition: Grid1DInterpolator.cc:91
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:42
Parameters
this enum provides names for possible meteogrids (from an ARPS file, etc)
Definition: MeteoData.h:46
Definition: Config.cc:30