MeteoIODoc  MeteoIODoc-2.9.0
mio::USERInterpolation Class Reference

Detailed Description

Reads user provided gridded data on the disk.

By default, the grids are all in the GRID2DPATH directory given in the [Input] section and the file extension is assumed to be ".asc". But the following arguments allow overriding it:

  • SUBDIR: look for grids in the provided subdirectory of GRID2DPATH;
  • EXT: use another file extension. The files must be named according to the following schema: {numeric date with second resolution}_{capitalized meteo parameter}.{ext}, for example 20081201150000_TA.asc. But the following argument allows overriding this.
  • TIME_CONSTANT: if true, use the same grid for all timesteps (default: false). If TIME_CONSTANT is set to true, files must be named according to: {capitalized meteo parameter}.{ext}, for example TA.asc.

The meteo parameters can be found in MeteoData. Examples of use:

TA::algorithms = USER # read grids from GRID2DPATH using the GRID2D plugin
VW::algorithms = USER # read grids from GRID2DPATH/wind
VW::user::subdir = wind
PSUM::algorithms = USER # read grids from GRID2DPATH/precip with the ".dat" extension
PSUM::user::subdir = precip
PSUM::user::ext = .dat
TSG::algorithms = USER # read grids from GRID2DPATH using the GRD2D plugin
TSG::user::ext = .asc
TSG::user::time_constant = TRUE # use the same grid for all timesteps.

If no grid exists for a given timestamp and parameter, the algorithm returns a zero rating so any other interpolation algorithm can pickup and provide a fallback. Therefore, it is not necessary to provide grids for all time steps but one can focuss on only the relevant and interesting time steps.

#include <UserAlgorithm.h>

Public Member Functions

 USERInterpolation (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm, GridsManager &i_gdm)
 
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 ()
 
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

◆ USERInterpolation()

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

Member Function Documentation

◆ calculate()

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

◆ getQualityRating()

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

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