Generate daily variations of a given amplitude around a single daily average. The paremeter to be interpolated is assumed to be a daily average and a sinusoidal variation of the amplitude given as argument will be generated (it is also possible to provide the "phase" or the fraction of the day when the minimum is reached). If data bearing the same name followed by "_MIN" or "_MAX" exist, there is no need to provide an amplitude as they will be used instead (but if the amplitude is provided, it will be used as a fallback when no min or max is available).
#include <DailyAverageResampling.h>
Public Member Functions | |
DailyAverage (const std::string &i_algoname, const std::string &i_parname, const double &dflt_window_size, const std::vector< std::string > &vecArgs) | |
void | resample (const size_t &index, const ResamplingPosition &position, const size_t ¶mindex, const std::vector< MeteoData > &vecM, MeteoData &md) |
std::string | toString () const |
![]() | |
ResamplingAlgorithms (const std::string &i_algoname, const std::string &i_parname, const double &dflt_window_size, const std::vector< std::string > &) | |
virtual | ~ResamplingAlgorithms () |
const std::string | getAlgo () const |
Additional Inherited Members | |
![]() | |
enum | ResamplingPosition { exact_match, before, after, begin, end } |
![]() | |
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 void | getNearestValidPts (const size_t &pos, const size_t ¶mindex, const std::vector< MeteoData > &vecM, const Date &resampling_date, const double &window_size, size_t &indexP1, size_t &indexP2) |
This function returns the last and next valid points around a given position. More... | |
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. More... | |
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) More... | |
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. More... | |
![]() | |
const std::string | algo |
const std::string | parname |
double | window_size |
![]() | |
static const double | soil_albedo = .23 |
grass albedo More... | |
static const double | snow_albedo = .85 |
snow albedo More... | |
static const double | snow_thresh = .1 |
These thresholds are used to handle solar radiation. More... | |
mio::DailyAverage::DailyAverage | ( | const std::string & | i_algoname, |
const std::string & | i_parname, | ||
const double & | dflt_window_size, | ||
const std::vector< std::string > & | vecArgs | ||
) |
|
virtual |
Implements mio::ResamplingAlgorithms.
|
virtual |
Implements mio::ResamplingAlgorithms.