MeteoIODoc 2.11.0
DataGenerator.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2013 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 DATAGENERATOR_H
21#define DATAGENERATOR_H
22
23#include <meteoio/Config.h>
26
27#include <vector>
28#include <map>
29#include <set>
30
31namespace mio {
32
44 public:
45 DataGenerator(const Config& cfg, const std::set<std::string>& params_to_generate = std::set<std::string>());
46 DataGenerator(const DataGenerator& c) : mapAlgorithms(c.mapAlgorithms), data_qa_logs(c.data_qa_logs) {}
47 virtual ~DataGenerator();
48
49 void fillMissing(METEO_SET& vecMeteo, const std::vector<METEO_SET>& fullDataset, const std::vector<size_t>& stations_idx) const;
50 void fillMissing(METEO_SET& vecMeteo) const; //simplified call similar to above
51 void fillMissing(std::vector<METEO_SET>& vecVecMeteo) const;
52
54
55 const std::string toString() const;
56 private:
57 static std::set<std::string> getParameters(const Config& cfg);
58 static std::vector< GeneratorAlgorithm* > buildStack(const Config& cfg, const std::string& parname);
59
60 std::map< std::string, std::vector<GeneratorAlgorithm*> > mapAlgorithms; //per parameter data creators algorithms
61 static const std::string cmd_section, cmd_pattern, arg_pattern;
62 bool data_qa_logs;
63};
64
65} //end namespace
66
67#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 generate meteo data from user-selected models or parametrizations. This class sits in betw...
Definition: DataGenerator.h:43
virtual ~DataGenerator()
Definition: DataGenerator.cc:54
DataGenerator & operator=(const DataGenerator &source)
Definition: DataGenerator.cc:63
DataGenerator(const Config &cfg, const std::set< std::string > &params_to_generate=std::set< std::string >())
Definition: DataGenerator.cc:33
DataGenerator(const DataGenerator &c)
Definition: DataGenerator.h:46
const std::string toString() const
Definition: DataGenerator.cc:242
void fillMissing(METEO_SET &vecMeteo, const std::vector< METEO_SET > &fullDataset, const std::vector< size_t > &stations_idx) const
generate data to fill missing data points. This relies on data generators defined by the user for eac...
Definition: DataGenerator.cc:94
Definition: Config.cc:31
std::vector< MeteoData > METEO_SET
Definition: MeteoData.h:32