MeteoIODoc 2.11.0
mio::Trend Class Reference

#include <InterpolationAlgorithms.h>

Public Member Functions

 Trend (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &algo, const std::string &i_param)
 Build a Trend object. More...
 
void detrend (const std::vector< StationData > &vecMeta, std::vector< double > &vecDat)
 Compute the trend according to the provided data and detrend vecDat. More...
 
void retrend (const DEMObject &dem, Grid2DObject &grid) const
 Re-apply the trend computed in a previous call to detrend() to the gridded results. More...
 
std::string getInfo () const
 
bool has_user_lapse () const
 
bool is_soft () const
 
std::string toString () const
 

Constructor & Destructor Documentation

◆ Trend()

mio::Trend::Trend ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  algo,
const std::string &  i_param 
)

Build a Trend object.

This object is responsible for detrending / retrending the meteorological data. The following arguments are recognized:

  • MULTILINEAR: use a multiple linear regression (on altitude, easting and northing) if possible, otherwise a "standard", simple linear regression will be used as fallback (default: false);
  • RATE: to provide a user-defined lapse rate (SI units);
  • SOFT: if set to true, the user provided lapse rate is only used when no lapse rate could be computed from the data (or if it was too bad, ie r²<0.6);
  • FRAC: if set to true, the user provided lapse rate will be interpreted as "fractional", that is a relative change of the value as a function of the elevation (for example, +0.05% per meters given as 0.0005). In this case, no attempt to calculate the fractional lapse from the data is made. The lapse rate that might be reported to the user will be computed as {data average}*{user-defined rate} and is therefore NOT directly the user-defined lapse rate.
  • TREND_MIN_ALT: all points at elevations less than this will be detrended/retrended as if at this provided elevation (optional);
  • TREND_MAX_ALT: all points at elevations more than this will be detrended/retrended as if at this provided elevation (optional);
Parameters
[in]vecArgsa vector containing all the arguments
[in]algothe name of the algorithm calling it, for user-friendly error messages
[in]i_paramthe meteorological parameter that is handled, for user-friendly error messages

Member Function Documentation

◆ detrend()

void mio::Trend::detrend ( const std::vector< StationData > &  vecMeta,
std::vector< double > &  vecDat 
)

Compute the trend according to the provided data and detrend vecDat.

Parameters
[in]vecMetaLocation information sorted similarly as the data in vecDat
vecDatdata for the interpolated parameter

◆ getInfo()

std::string mio::Trend::getInfo ( ) const

◆ has_user_lapse()

bool mio::Trend::has_user_lapse ( ) const
inline

◆ is_soft()

bool mio::Trend::is_soft ( ) const
inline

◆ retrend()

void mio::Trend::retrend ( const DEMObject dem,
Grid2DObject grid 
) const

Re-apply the trend computed in a previous call to detrend() to the gridded results.

Parameters
[in]demdigital elevation model (DEM)
gridmatching grid filled with data that has to be re-trended

◆ toString()

std::string mio::Trend::toString ( ) const

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