19#ifndef DATAEDITINGALGS_H
20#define DATAEDITINGALGS_H
37 EditingBlock(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
47 virtual void editTimeSeries(std::vector<METEO_SET>& vecMeteo) {(void)vecMeteo;}
61 virtual std::set<std::string>
requiredIDs()
const {
return std::set<std::string>();}
67 virtual std::set<std::string>
providedIDs()
const {
return std::set<std::string>();}
79 static std::set<std::string>
initStationSet(
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& keyword);
80 bool skipStation(
const std::vector<MeteoData>& vecMeteo)
const;
105 EditingSwap(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
110 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
111 std::string dest_param, src_param;
141 EditingRename(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
146 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
147 std::set< std::string > src_params;
148 std::string dest_param;
172 EditingExclude(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
177 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
178 void processStation(
METEO_SET& vecMeteo,
const size_t& startIdx,
const size_t& endIdx,
const std::set< std::string >& params)
const;
179 std::set< std::string > exclude_params;
203 EditingKeep(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
206 static void processStation(
METEO_SET& vecMeteo,
const size_t& startIdx,
const size_t& endIdx,
const std::set< std::string >& params);
209 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
210 std::set< std::string > keep_params;
264 EditingMerge(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
271 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
272 std::vector< std::string > merged_stations;
273 std::set< std::string > merged_params;
275 MeteoData::MERGE_CONFLICTS merge_conflicts;
297 EditingAutoMerge(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
303 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
304 static void mergeStations(
const size_t& toStationIdx,
STATIONS_SET& vecStation);
305 void mergeMeteo(
const size_t& toStationIdx, std::vector<METEO_SET>& vecMeteo)
const;
307 MeteoData::MERGE_CONFLICTS merge_conflicts;
330 EditingCopy(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
335 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
336 std::string dest_param, src_param;
371 EditingCreate(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
376 static const std::vector< std::pair<std::string, std::string> > cleanGeneratorArgs(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
377 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
380 const std::vector< std::pair<std::string, std::string> > vecArgs_copy;
381 std::string algorithm, dest_param;
424 EditingMetadata(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
433 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
434 void mergeMigratedData(std::vector<METEO_SET>& vecMeteo,
const std::vector<METEO_SET>& vecTmp)
const;
436 std::string new_name, new_id;
437 double lat, lon, alt, slope, azi;
486 EditingRegFill(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
491 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
493 std::vector< std::string > source_stations;
494 std::set< std::string > params_to_merge;
500 static EditingBlock*
getBlock(
const std::string& i_stationID,
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config &cfg);
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
AUTOMERGE input editing command.
Definition: DataEditingAlgorithms.h:295
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:477
EditingAutoMerge(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:398
Definition: DataEditingAlgorithms.h:498
static EditingBlock * getBlock(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:129
Base class for DataEditing algorithms.
Definition: DataEditingAlgorithms.h:35
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.h:47
std::string getName() const
Definition: DataEditingAlgorithms.h:78
virtual ~EditingBlock()
Definition: DataEditingAlgorithms.h:39
const std::vector< DateRange > time_restrictions
Definition: DataEditingAlgorithms.h:84
virtual std::set< std::string > requiredIDs() const
Get the station IDs this editing block depends on for this station.
Definition: DataEditingAlgorithms.h:61
const std::set< std::string > kept_stations
Definition: DataEditingAlgorithms.h:83
const std::string toString() const
Definition: DataEditingAlgorithms.cc:122
METEO_SET timeFilterFromStation(const METEO_SET &vecMeteo) const
Prepare a station that will be merged in case of time restrictions.
Definition: DataEditingAlgorithms.cc:168
const std::string stationID
Definition: DataEditingAlgorithms.h:85
bool skipStation(const std::vector< MeteoData > &vecMeteo) const
Return true if this station ID should be skipped.
Definition: DataEditingAlgorithms.cc:110
const std::string block_name
Definition: DataEditingAlgorithms.h:85
virtual void editTimeSeries(STATIONS_SET &vecStation)
Apply this editing block to the StationData.
Definition: DataEditingAlgorithms.h:55
static std::set< std::string > initStationSet(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &keyword)
Definition: DataEditingAlgorithms.cc:85
EditingBlock(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:82
const std::set< std::string > excluded_stations
Definition: DataEditingAlgorithms.h:83
virtual std::set< std::string > purgeIDs() const
Get the station IDs to purge after using them for this station ID.
Definition: DataEditingAlgorithms.h:73
virtual std::set< std::string > providedIDs() const
Get the station IDs this editing block provides based on this station.
Definition: DataEditingAlgorithms.h:67
COPY input editing command.
Definition: DataEditingAlgorithms.h:328
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:639
EditingCopy(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:612
CREATE input editing command.
Definition: DataEditingAlgorithms.h:369
EditingCreate(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:658
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:696
EXCLUDE input editing command.
Definition: DataEditingAlgorithms.h:170
EditingExclude(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:289
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:328
KEEP input editing command.
Definition: DataEditingAlgorithms.h:201
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:384
EditingKeep(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:345
static void processStation(METEO_SET &vecMeteo, const size_t &startIdx, const size_t &endIdx, const std::set< std::string > ¶ms)
Definition: DataEditingAlgorithms.cc:366
MERGE input editing command.
Definition: DataEditingAlgorithms.h:262
std::set< std::string > requiredIDs() const
Get the station IDs this editing block depends on for this station.
Definition: DataEditingAlgorithms.cc:604
EditingMerge(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:503
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:563
RegFill input editing command.
Definition: DataEditingAlgorithms.h:477
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:938
EditingRegFill(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:874
RegressionType
Definition: DataEditingAlgorithms.h:479
@ QUADRATIC
Definition: DataEditingAlgorithms.h:481
@ CUBIC
Definition: DataEditingAlgorithms.h:482
@ LINEAR
Definition: DataEditingAlgorithms.h:480
RENAME input editing command.
Definition: DataEditingAlgorithms.h:139
EditingRename(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:235
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:263
SWAP input editing command.
Definition: DataEditingAlgorithms.h:103
virtual void editTimeSeries(std::vector< METEO_SET > &vecMeteo)
Apply this editing block.
Definition: DataEditingAlgorithms.cc:212
EditingSwap(const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: DataEditingAlgorithms.cc:185
Merge_Type
Available MeteoData merging strategies. When the two stations both have data at a given time step,...
Definition: MeteoData.h:125
std::vector< MeteoData > METEO_SET
Definition: MeteoData.h:32
std::vector< StationData > STATIONS_SET
Definition: StationData.h:141