MeteoIODoc 20241221.207bde49
mio::EditingCombine Class Reference

Detailed Description

COMBINE input editing command.

This algorithm allows combining several parameters into a single parameter for gap filling or to create a new, composite parameter. This is useful, for example in order to fill gaps in a 2m air temperature with air temperatures from other sensors or from other heights. Several methods to combine the parameters are available with the TYPE argument and an arbitrary number of source parameters can be provided. Please note that after processing, the source parameters will be deleted! It takes the following arguments:

  • SRC: the source parameters providing the data (space delimited list);
  • DEST: the destination parameter (it will be created if it does not already exist);
  • TYPE: how to generate the data provided by the source parameters (default: FIRST):
    • FIRST: take the first valid data (in the order that is given by the SRC argument);
    • MIN: take the minimum of all valid data;
    • AVG: take the average of all valid data;
    • MAX: take the maximum of all valid data;
  • REPLACE: if set to TRUE, even valid DEST data points will be replaced, otherwise only data gaps in DEST will be filled with new data (default: false).
Note
Please note that for MIN/AVG/MAX, the current value of DEST is included if it is a valid value! If you want to replace valid values of DEST with for example the average of several other parameters excluding itself, first declare a KEEP or EXCLUDE algorithm for the period of interest in order to delete DEST.
Warning
If the parameters to combine don't have the same sampling rate, the results will be some interlaced output alternating between the different sources. For example combining an hourly precipitation with a 10 minutes precipitation reanalysis would lead to five reanalysis values followed by an hourly measurement (and repeated over the whole dataset duration). If this is not what you want (most probably), then first declare an EXCLUDE or KEEP editing operation over the period of interest.
[Input]
METEO = SMET
METEOPATH = ./input
STATION1 = STB
[...]
[InputEditing]
STB::edit2 = COMBINE
STB::arg2::src = TA_THY TA_ROT TA@100
STB::arg2::dest = TA

#include <DataEditingAlgorithms.h>

Public Types

enum  CombineType { FIRST , MIN , AVG , MAX }
 

Public Member Functions

 EditingCombine (const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
 
virtual void editTimeSeries (std::vector< METEO_SET > &vecMeteo)
 Apply this editing block. More...
 
- Public Member Functions inherited from mio::EditingBlock
 EditingBlock (const std::string &i_stationID, const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
 
virtual ~EditingBlock ()
 
virtual void editTimeSeries (std::vector< METEO_SET > &vecMeteo)
 Apply this editing block. More...
 
virtual void editTimeSeries (STATIONS_SET &vecStation)
 Apply this editing block to the StationData. More...
 
virtual std::set< std::string > requiredIDs () const
 Get the station IDs this editing block depends on for this station. More...
 
virtual std::set< std::string > providedIDs () const
 Get the station IDs this editing block provides based on this station. More...
 
virtual std::set< std::string > purgeIDs () const
 Get the station IDs to purge after using them for this station ID. More...
 
const std::string toString () const
 

Additional Inherited Members

- Protected Member Functions inherited from mio::EditingBlock
std::string getName () const
 
bool skipStation (const std::vector< MeteoData > &vecMeteo) const
 Return true if this station ID should be skipped. More...
 
METEO_SET timeFilterFromStation (const METEO_SET &vecMeteo) const
 Prepare a station that will be merged in case of time restrictions. More...
 
- Static Protected Member Functions inherited from mio::EditingBlock
static std::set< std::string > initStationSet (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &keyword)
 
- Protected Attributes inherited from mio::EditingBlock
const std::set< std::string > excluded_stations
 
const std::set< std::string > kept_stations
 
const std::vector< DateRangetime_restrictions
 
const std::string stationID
 
const std::string block_name
 

Member Enumeration Documentation

◆ CombineType

Enumerator
FIRST 

take the first valid data

MIN 

take the MIN of all valid data

AVG 

take the average of all valid data

MAX 

take the MAX of all valid data

Constructor & Destructor Documentation

◆ EditingCombine()

mio::EditingCombine::EditingCombine ( const std::string &  i_stationID,
const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  name,
const Config cfg 
)

Member Function Documentation

◆ editTimeSeries()

void mio::EditingCombine::editTimeSeries ( std::vector< METEO_SET > &  vecMeteo)
virtual

Apply this editing block.

This applies the editing block for its station that has been declared in the constructor on the provided MeteoData timeseries.

Parameters
vecMeteoMeteoData timeseries for all stations

Reimplemented from mio::EditingBlock.


The documentation for this class was generated from the following files: