MeteoIODoc 20261003.b9219c1f
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
mio::ResamplingStack Class Reference

#include <ResamplingStack.h>

Public Member Functions

 ResamplingStack (const Config &cfg, const std::string &i_gap_size_key, const std::string &parname, const IOUtils::OperationMode &mode=IOUtils::STD, const char &rank=1, const bool &isDefault=false, const double &i_fallback_gap_size=0.0)
 
std::vector< std::shared_ptr< ResamplingAlgorithms > > buildStack (const ResamplingAlgorithms::gap_info &gap) const
 
void resetResampling ()
 
void resample (const std::string &stationHash, const size_t &pos, const ResamplingAlgorithms::ResamplingPosition elementpos, const size_t &paramindex, const std::vector< MeteoData > &vecM, MeteoData &md) const
 Perform the resampling for a specific data point.
 
std::string getStackStr () const
 
bool isEmpty () const
 

Constructor & Destructor Documentation

◆ ResamplingStack()

mio::ResamplingStack::ResamplingStack ( const Config &  cfg,
const std::string &  i_gap_size_key,
const std::string &  parname,
const IOUtils::OperationMode &  mode = IOUtils::STD,
const char &  rank = 1,
const bool &  isDefault = false,
const double &  i_fallback_gap_size = 0.0 
)

Member Function Documentation

◆ buildStack()

std::vector< std::shared_ptr< ResamplingAlgorithms > > mio::ResamplingStack::buildStack ( const ResamplingAlgorithms::gap_info &  gap) const

◆ getStackStr()

std::string mio::ResamplingStack::getStackStr ( ) const

◆ isEmpty()

bool mio::ResamplingStack::isEmpty ( ) const
inline

◆ resample()

void mio::ResamplingStack::resample ( const std::string &  stationHash,
const size_t &  pos,
const ResamplingAlgorithms::ResamplingPosition  elementpos,
const size_t &  paramindex,
const std::vector< MeteoData > &  vecM,
MeteoData &  md 
) const

Perform the resampling for a specific data point.

This call walks through a stack of resampling algorithms (defined by the user in the INI file) and calls each algorithm one by one, until an algorithm takes the resampling task. Data gaps are identified and cached in order to make the processing more efficient.

Parameters
[in]stationHashHash used to uniquely identify the station within a vector< vector<MeteoData> >, used for caching
[in]posPosition of the requested element in vecM or the next element if the exact requested could not be found
[in]elementposDescribes the resampling context: exact match (an element for the requested timestamp exists), extrapolation at the begining or at the end, interpolation between two existing elements
[in]paramindexIndex of the meteorological parameter to process (for example: MeteoData::TA)
[in]vecMMeteorological timeseries for this station in order to have context (points before/after the requested point)
[out]mdMeteoData object to write the resampled data point to. Its date has been set to the requested date.

◆ resetResampling()

void mio::ResamplingStack::resetResampling ( )

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