|
MeteoIODoc 20261003.b9219c1f
Environmental timeseries pre-processing
|
Generate daily variations around a single daily average.
The parameter to be interpolated is assumed to be a daily average and a sinusoidal variation of the data will be generated around this average.
Either one or two additional parameters bearing the same name followed by "_MIN" and/or "_MAX" are provided or a fixed amplitude is provided as argument (it will also be used as a fallback if the _MIN and _MAX parameters are missing at some timesteps). Iit is also possible to provide the "phase" or the fraction of the day when the minimum is reached.
#include <DailyAverageResampling.h>
Public Member Functions | |
| DailyAverage (const std::string &i_algoname, const std::string &i_parname, const double &dflt_max_gap_size, const std::vector< std::pair< std::string, std::string > > &vecArgs) | |
| bool | resample (const std::string &stationHash, const size_t &index, const ResamplingPosition &position, const size_t ¶mindex, const std::vector< MeteoData > &vecM, MeteoData &md, const gap_info &gap, const bool &exactMatch) override |
| std::string | toString () const override |
Public Member Functions inherited from mio::ResamplingAlgorithms | |
| ResamplingAlgorithms (const std::string &i_algoname, const std::string &i_parname, const double &dflt_max_gap_size, const std::vector< std::pair< std::string, std::string > > &) | |
| virtual | ~ResamplingAlgorithms () |
| gap_info | findGap (const std::string &stationHash, const size_t &pos, const size_t ¶mindex, const std::vector< MeteoData > &vecM, const Date &resampling_date, const double &i_max_gap_size) |
| Find a data gap around a given position. | |
| void | resetResampling () |
| const std::string | getAlgo () const |
| double | getMaxGapSize () const |
Additional Inherited Members | |
Public Types inherited from mio::ResamplingAlgorithms | |
| enum | ResamplingPosition { hasTimestamp , inGap , begin , end } |
| using | gap_info = GapInfo |
Static Protected Member Functions inherited from mio::ResamplingAlgorithms | |
| static double | partialAccumulateAtLeft (const std::vector< MeteoData > &vecM, const size_t ¶mindex, const size_t &pos, const Date &curr_date) |
| |
| static double | partialAccumulateAtRight (const std::vector< MeteoData > &vecM, const size_t ¶mindex, const size_t &pos, const Date &curr_date) |
| static double | linearInterpolation (const double &x1, const double &y1, const double &x2, const double &y2, const double &x3) |
| This function solves the equation y = ax + b for two given points and returns y for a given x. | |
| static Date | getDailyStart (const Date &resampling_date) |
| For a given date, find the start of the day, considering that for midnight we return the day before! (as is necessary for daily averages, sums, etc that can be provided at midnight for the day before) | |
| static size_t | getDailyValue (const std::vector< MeteoData > &vecM, const size_t ¶mindex, size_t pos, const Date &intervalStart, const Date &intervalEnd) |
| Find a unique value in a given time interval. This is useful for retrieving a unique daily average, daily sum, etc. | |
Protected Attributes inherited from mio::ResamplingAlgorithms | |
| bool | allowExtrapolate = false |
| const std::string | algo |
| const std::string | parname |
| double | max_gap_size |
| Maximum extend of a data gap over which to interpolate. | |
| mio::DailyAverage::DailyAverage | ( | const std::string & | i_algoname, |
| const std::string & | i_parname, | ||
| const double & | dflt_max_gap_size, | ||
| const std::vector< std::pair< std::string, std::string > > & | vecArgs | ||
| ) |
|
overridevirtual |
Implements mio::ResamplingAlgorithms.
|
overridevirtual |
Implements mio::ResamplingAlgorithms.