MeteoIODoc 20240508.aefd3c94
GridProcessor.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 GRIDPROCESSOR_H
21#define GRIDPROCESSOR_H
22
24#include <meteoio/Config.h>
26
27#include <map>
28#include <string>
29#include <vector>
30
31namespace mio {
32
40 public:
41 GridProcessor(const Config& cfg);
42 bool resample(const Date& date, const MeteoGrids::Parameters& parameter, const std::map<Date, Grid2DObject>& all_grids, Grid2DObject& resampled_grid);
43 static std::map<Date, Grid2DObject>::const_iterator seek(const Date& date, const std::map<Date, Grid2DObject>& grids, const bool& exact_match = false);
44 static std::map<Date, Grid2DObject>::const_iterator seek_before(const Date& date, const std::map<Date, Grid2DObject>& grids);
45 static std::map<Date, Grid2DObject>::const_iterator seek_after(const Date& date, const std::map<Date, Grid2DObject>& grids);
46 double getWindowSize() const { return gi1d.getWindowSize(); }
47
48 private:
49 static std::set<std::string> getParameters(const Config& cfg);
50
52 bool enable_grid_filtering = false;
53};
54
55} //end namespace
56
57#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
double getWindowSize() const
Definition: Grid1DInterpolator.h:47
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:42
This class is handled by a GridManager and performs grid filtering and temporal resampling.
Definition: GridProcessor.h:39
static std::map< Date, Grid2DObject >::const_iterator seek(const Date &date, const std::map< Date, Grid2DObject > &grids, const bool &exact_match=false)
Search a list of grids for a specific date.
Definition: GridProcessor.cc:62
GridProcessor(const Config &cfg)
Constructor for a grid processor.
Definition: GridProcessor.cc:32
double getWindowSize() const
Definition: GridProcessor.h:46
static std::map< Date, Grid2DObject >::const_iterator seek_before(const Date &date, const std::map< Date, Grid2DObject > &grids)
Find a grid that is available right after a specific date.
Definition: GridProcessor.cc:86
static std::map< Date, Grid2DObject >::const_iterator seek_after(const Date &date, const std::map< Date, Grid2DObject > &grids)
Find a grid that is available before a specific date.
Definition: GridProcessor.cc:109
bool resample(const Date &date, const MeteoGrids::Parameters &parameter, const std::map< Date, Grid2DObject > &all_grids, Grid2DObject &resampled_grid)
This function forwards interpolation requests.
Definition: GridProcessor.cc:48
Parameters
this enum provides names for possible meteogrids (from an ARPS file, etc)
Definition: MeteoData.h:46
Definition: Config.cc:31