MeteoIODoc  2.10.0
DataEditing.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 /***********************************************************************************/
3 /* Copyright 2020 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 #ifndef DATAEDITING_H
20 #define DATAEDITING_H
21 
22 #include <meteoio/IOInterface.h>
25 
26 #include <map>
27 #include <set>
28 #include <string>
29 
30 namespace mio {
31 
45 class DataEditing {
46  public:
47  DataEditing(const Config&);
48 
50 
51  virtual ~DataEditing();
52 
53  static void purgeTrailingNodata(std::vector<METEO_SET>& vecMeteo);
54 
55  void editTimeSeries(std::vector<METEO_SET>& vecMeteo);
56  void editTimeSeries(STATIONS_SET& vecStation);
57 
58  const std::string toString() const;
59 
61 
62  private:
63  static std::set<std::string> getEditableStations(const Config& cfg);
64  static std::vector< EditingBlock* > buildStack(const Config& cfg, const std::string& station_ID);
65  std::map< std::string, std::set<std::string> > getDependencies() const;
66  std::set<std::string> getMergedFromIDs() const;
67  static std::vector<std::string> getProcessingOrder(std::map< std::string, std::set<std::string> > dependencies);
68 
69  std::map< std::string, std::vector< EditingBlock* > > editingStack;
70  static const std::string cmd_section, cmd_pattern, arg_pattern;
71  static const char NUM[];
72  bool enable_ts_editing;
73 };
74 
75 } //namespace
76 
77 #endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
Definition: DataEditing.h:45
DataEditing(const Config &)
Definition: DataEditing.cc:37
static void purgeTrailingNodata(std::vector< METEO_SET > &vecMeteo)
Definition: DataEditing.cc:306
virtual ~DataEditing()
Definition: DataEditing.cc:49
DataEditing & operator=(const DataEditing &)
Assignement operator.
Definition: DataEditing.cc:56
void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Definition: DataEditing.cc:258
TimeProcStack timeproc
Definition: DataEditing.h:60
const std::string toString() const
Definition: DataEditing.cc:319
Since the time filters are quite specific to TIME (and need to be applied before),...
Definition: TimeFilters.h:33
Definition: Config.cc:30
std::vector< StationData > STATIONS_SET
Definition: StationData.h:141