MeteoIODoc 20240415.d3bdb3cb
mio::LocalIDWLapseAlgorithm Class Reference

Detailed Description

Inverse Distance Weighting interpolation algorithm with elevation detrending/reprojection.

The closest n stations to each pixel are used to compute the local lapse rate, allowing to project the contributions of these n stations to the local pixel with an inverse distance weight. It therefore takes the following arguments:

  • NEIGHBORS: how many neighbouring stations should be used;
  • MAX_DISTANCE: maximum allowed distance (in meters) between the stations and grid points to interpolate to;
  • SCALE: this is a scaling parameter to smooth the IDW distribution. In effect, this is added to the distance in order to move into the tail of the 1/d distribution (default: 1000m);
  • ALPHA: this is an exponent to the 1/d distribution (default: 1);

Either NEIGHBORS or MAX_DISTANCE needs to be specified. When both are specified, both restrictions are used. In such cases, only stations less than MAX_DISTANCE away from the grid point to interpolate to are used, up to a maximum of n stations. This can lead to less than n stations to be included in the interpolation.

Note
Beware, this method sometimes produces very sharp transitions as it spatially moves from one station's area of influence to another one!
TA::algorithms = LIDW_LAPSE
TA::lidw_lapse::neighbors = 6

#include <IDWLapseLocalAlgorithm.h>

Public Member Functions

 LocalIDWLapseAlgorithm (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm)
 
virtual double getQualityRating (const Date &i_date)
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)
 
- Public Member Functions inherited from mio::InterpolationAlgorithm
 InterpolationAlgorithm (const std::vector< std::pair< std::string, std::string > > &, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm)
 
virtual ~InterpolationAlgorithm ()
 
virtual double getQualityRating (const Date &i_date)=0
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)=0
 
std::string getInfo () const
 Return an information string about the interpolation process. More...
 

Additional Inherited Members

- Public Attributes inherited from mio::InterpolationAlgorithm
const std::string algo
 
- Protected Member Functions inherited from mio::InterpolationAlgorithm
std::vector< double > getData (const Date &i_date, const std::string &i_param)
 
size_t getData (const Date &i_date, const std::string &i_param, std::vector< double > &o_vecData, std::vector< StationData > &o_vecMeta)
 
- Protected Attributes inherited from mio::InterpolationAlgorithm
TimeSeriesManagertsmanager
 
Date date
 
std::vector< MeteoDatavecMeteo
 
std::vector< double > vecData
 store the measurement for the given parameter More...
 
std::vector< StationDatavecMeta
 store the station data for the given parameter More...
 
std::ostringstream info
 to store some extra information about the interplation process More...
 
const std::string param
 the parameter that we will interpolate More...
 
size_t nrOfMeasurments
 Number of stations that have been used, so this can be reported to the user. More...
 

Constructor & Destructor Documentation

◆ LocalIDWLapseAlgorithm()

mio::LocalIDWLapseAlgorithm::LocalIDWLapseAlgorithm ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  i_algo,
const std::string &  i_param,
TimeSeriesManager i_tsm 
)

Member Function Documentation

◆ calculate()

void mio::LocalIDWLapseAlgorithm::calculate ( const DEMObject dem,
Grid2DObject grid 
)
virtual

◆ getQualityRating()

double mio::LocalIDWLapseAlgorithm::getQualityRating ( const Date i_date)
virtual

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