MeteoIODoc 20260620.13b5b0a5
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
Meteo2DInterpolator.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2014 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
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 METEO2DINTERPOLATOR_H
21#define METEO2DINTERPOLATOR_H
22
24#include <meteoio/Config.h>
29
30#include <vector>
31#include <map>
32#include <set>
33#include <utility>
34#include <string>
35
36namespace mio {
37
38class InterpolationAlgorithm;
39
101 public:
105 Meteo2DInterpolator(const Config& i_cfg, TimeSeriesManager& i_tsmanager, GridsManager& i_gridsmanager);
108
110
122 std::string interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
123 Grid2DObject& result, const bool& quiet=false);
124
125 std::string interpolate(const Date& date, const DEMObject& dem, const std::string& param_name,
126 Grid2DObject& result, const bool& quiet=false);
127
128 std::string interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
129 std::vector<Coords> vec_coords, std::vector<double>& result, const bool& quiet=false);
130
131 std::string interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
132 std::vector<StationData> vec_stations, std::vector<double>& result, const bool& quiet=false);
133
141 std::vector< std::pair<std::string, std::string> > getArgumentsForAlgorithm(const std::string& parname,
142 const std::string& algorithm, const std::string& section) const;
143
144 const std::string toString() const;
145
146 private:
147 static void checkMinMax(const double& minval, const double& maxval, Grid2DObject& gridobj);
148 static void check_projections(const DEMObject& dem, const std::vector<MeteoData>& vec_meteo);
149 static std::set<std::string> getParameters(const Config& i_cfg);
150 static std::vector<std::string> getAlgorithmsForParameter(const Config& i_cfg, const std::string& parname);
151
152 void setAlgorithms();
153
154 const Config& cfg;
155 TimeSeriesManager *tsmanager;
156 GridsManager *gridsmanager;
157 GridBuffer grid_buffer;
158
159 std::map< std::string, std::vector<InterpolationAlgorithm*> > mapAlgorithms; //per parameter interpolation algorithms
160
161 bool algorithms_ready;
162 bool use_full_dem;
163};
164
165} //end namespace
166
167#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 represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition DEMObject.h:40
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition Date.h:87
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition Grid2DObject.h:42
A class to buffer gridded data. This class buffers Grid2D objects. It implements a proper ring buffer...
Definition Buffer.h:157
Definition GridsManager.h:36
A class to spatially interpolate meteo parameters. For more, see Spatial interpolations.
Definition Meteo2DInterpolator.h:100
const std::string toString() const
Definition Meteo2DInterpolator.cc:335
~Meteo2DInterpolator()
Definition Meteo2DInterpolator.cc:59
std::vector< std::pair< std::string, std::string > > getArgumentsForAlgorithm(const std::string &parname, const std::string &algorithm, const std::string &section) const
Retrieve the arguments vector for a given interpolation algorithm.
Definition Meteo2DInterpolator.cc:136
Meteo2DInterpolator & operator=(const Meteo2DInterpolator &)
Assignement operator.
Definition Meteo2DInterpolator.cc:46
std::string interpolate(const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, Grid2DObject &result, const bool &quiet=false)
A generic function that can interpolate for any given MeteoData member variable.
Definition Meteo2DInterpolator.cc:153
Parameters
this enum provides indexed access to meteorological fields
Definition MeteoData.h:145
Definition TimeSeriesManager.h:36
Definition Config.cc:34