The base class for all filters that provides the interface and a few helper methods.
#include <ProcessingBlock.h>
Public Member Functions | |
virtual | ~ProcessingBlock () |
virtual void | process (const unsigned int ¶m, const std::vector< MeteoData > &ivec, std::vector< MeteoData > &ovec)=0 |
virtual void | process (Date &dateStart, Date &dateEnd) |
std::string | getName () const |
const ProcessingProperties & | getProperties () const |
const std::string | toString () const |
bool | skipStation (const std::string &station_id) const |
Should the provided station be skipped in the processing? More... | |
bool | noStationsRestrictions () const |
const std::vector< DateRange > | getTimeRestrictions () const |
Static Public Member Functions | |
static void | readCorrections (const std::string &filter, const std::string &filename, std::vector< double > &X, std::vector< double > &Y) |
Read a data file structured as X Y value on each lines. More... | |
static void | readCorrections (const std::string &filter, const std::string &filename, std::vector< double > &X, std::vector< double > &Y1, std::vector< double > &Y2) |
Read a data file structured as X Y1 Y2 value on each lines. More... | |
static std::vector< double > | readCorrections (const std::string &filter, const std::string &filename, const size_t &col_idx, const char &c_type, const double &init) |
Read a correction file applicable to repeating time period. More... | |
static std::vector< offset_spec > | readCorrections (const std::string &filter, const std::string &filename, const double &TZ, const size_t &col_idx=2) |
Read a correction file, ie a file structured as timestamps followed by values on each lines. More... | |
static std::map< std::string, std::vector< DateRange > > | readDates (const std::string &filter, const std::string &filename, const double &TZ) |
Read a list of date ranges by stationIDs from a file. More... | |
Protected Member Functions | |
ProcessingBlock (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg) | |
protected constructor only to be called by children More... | |
Static Protected Member Functions | |
static void | extract_dbl_vector (const unsigned int ¶m, const std::vector< MeteoData > &ivec, std::vector< double > &ovec) |
static void | extract_dbl_vector (const unsigned int ¶m, const std::vector< const MeteoData * > &ivec, std::vector< double > &ovec) |
Protected Attributes | |
const std::set< std::string > | excluded_stations |
const std::set< std::string > | kept_stations |
const std::vector< DateRange > | time_restrictions |
ProcessingProperties | properties |
const std::string | block_name |
Static Protected Attributes | |
static const double | soil_albedo = .23 |
static const double | snow_albedo = .85 |
static const double | snow_thresh = .1 |
parametrize the albedo from HS More... | |
|
inlinevirtual |
|
protected |
protected constructor only to be called by children
|
staticprotected |
|
staticprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
Implemented in mio::FilterDeGrass, mio::FilterDespikingPS, mio::FilterKalman, mio::FilterMAD, mio::FilterMaths, mio::FilterMax, mio::FilterMin, mio::FilterMinMax, mio::FilterMinMaxConditional, mio::FilterNoChange, mio::FilterParticle, mio::FilterPotentialSW, mio::FilterRate, mio::FilterStdDev, mio::FilterSuppr, mio::FilterTimeconsistency, mio::FilterTukey, mio::FilterUnheatedPSUM, mio::ProcAdd, mio::ProcAggregate, mio::ProcDeAccumulate, mio::ProcExpSmoothing, mio::ProcIIR, mio::ProcMult, mio::ProcPSUMDistribute, mio::ProcQuantileMapping, mio::ProcReducePressure, mio::ProcRHWaterToIce, mio::ProcShade, mio::ProcShift, mio::ProcTransformWindVector, mio::ProcUndercatch_Forland, mio::ProcUndercatch_Hamon, mio::ProcUndercatch_WMO, mio::ProcUnventilatedT, mio::ProcWMASmoothing, mio::TimeSuppr, mio::TimeShift, mio::TimeSort, mio::TimeLoop, and mio::WindowedFilter.
Reimplemented in mio::TimeLoop.
|
static |
Read a correction file, ie a file structured as timestamps followed by values on each lines.
[in] | filter | Calling filter name for error reporting |
[in] | filename | file and path to open and read the data from |
[in] | TZ | default timezone for the timestamps |
[in] | col_idx | column to read the data from (column 1 contains the timestamps) |
|
static |
Read a correction file applicable to repeating time period.
This reads corrections to apply to repeating time periods, such as hours, dyas, months or years. Not all values must be provided as a default initial value is set. Depending on the time period, a check on the index range is performed (hours must be <=24, days <=366, months <=12, years have no maximum).
[in] | filter | Calling filter name for error reporting |
[in] | filename | file and path to open and read the data from |
[in] | col_idx | column to read the data from (column 1 contains the timestamps) |
[in] | c_type | expected time period |
[in] | init | default value to initalize the results |
|
static |
Read a data file structured as X Y value on each lines.
[in] | filter | Calling filter name for error reporting |
[in] | filename | file and path to open and read the data from |
[out] | X | vector of X values |
[out] | Y | vector of Y values |
|
static |
Read a data file structured as X Y1 Y2 value on each lines.
[in] | filter | Calling filter name for error reporting |
[in] | filename | file and path to open and read the data from |
[out] | X | vector of X values |
[out] | Y1 | vector of Y1 values |
[out] | Y2 | vector of Y2 values |
|
static |
Read a list of date ranges by stationIDs from a file.
Each station ID read in the provided file is attributed a list fo date ranges. For example, the file to read the data from can contain:
All these time ranges will populate a vector that will be mapped to the "*WFJ" station ID.
[in] | filter | Calling filter name for error reporting |
[in] | filename | file and path to open and read the data from |
[in] | TZ | default timezone for the timestamps |
bool mio::ProcessingBlock::skipStation | ( | const std::string & | station_id | ) | const |
Should the provided station be skipped in the processing?
[in] | station_id | stationID to test |
const std::string mio::ProcessingBlock::toString | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
parametrize the albedo from HS
|
staticprotected |
|
protected |