MeteoIODoc 20241221.207bde49
mio::GeneratorAlgorithm Class Referenceabstract

Detailed Description

Interface class for the generator models.

These models generate data for a specific parameter when all other options failed (the resampling could not help). Therefore, there is nothing more that could be done with the temporal history of the data, we have to use a totally different approach: either generic data (constant value, etc) or generate the data from other meteorological parameters (relying on a parametrization, like clear sky for ILWR).

#include <GeneratorAlgorithms.h>

Public Member Functions

virtual ~GeneratorAlgorithm ()
 
virtual bool generate (const size_t &param, MeteoData &md, const std::vector< MeteoData > &vecMeteo)=0
 
virtual bool create (const size_t &param, const size_t &ii_min, const size_t &ii_max, std::vector< MeteoData > &vecMeteo)=0
 Fill one time series of MeteoData for one station. More...
 
bool skipStation (const std::string &station_id) const
 Should this station be skipped, based on user-provided station ID restrictions? More...
 
bool skipTimeStep (const Date &dt) const
 Should this timestep be skipped, based on user-provided time restrictions? More...
 
bool skipHeight (const double &height) const
 
std::vector< DateRangegetTimeRestrictions () const
 
std::string getAlgo () const
 

Protected Member Functions

 GeneratorAlgorithm (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_section, const double &TZ)
 protected constructor only to be called by children More...
 
virtual void parse_args (const std::vector< std::pair< std::string, std::string > > &)
 
void initHeightRestrictions (const std::vector< std::pair< std::string, std::string > > vecArgs)
 

Static Protected Member Functions

static std::set< std::string > initStationSet (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &keyword)
 

Protected Attributes

const std::vector< DateRangetime_restrictions
 
const std::set< std::string > excluded_stations
 
const std::set< std::string > kept_stations
 
std::set< double > included_heights
 
std::set< double > excluded_heights
 
bool all_heights
 
const std::string algo
 
const std::string section
 

Static Protected Attributes

static const double soil_albedo = .23
 
static const double snow_albedo = .85
 
static const double snow_thresh = .1
 
static const double default_height = IOUtils::nodata
 

Constructor & Destructor Documentation

◆ ~GeneratorAlgorithm()

virtual mio::GeneratorAlgorithm::~GeneratorAlgorithm ( )
inlinevirtual

◆ GeneratorAlgorithm()

mio::GeneratorAlgorithm::GeneratorAlgorithm ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  i_algo,
const std::string &  i_section,
const double &  TZ 
)
protected

protected constructor only to be called by children

Member Function Documentation

◆ create()

virtual bool mio::GeneratorAlgorithm::create ( const size_t &  param,
const size_t &  ii_min,
const size_t &  ii_max,
std::vector< MeteoData > &  vecMeteo 
)
pure virtual

Fill one time series of MeteoData for one station.

This is used by the dataCreators to create a new parameter in one go for the whole timeseries.

Parameters
[in]parammeteo parameter to generate
[in]ii_minminimum index to apply it to in vecMeteo
[in]ii_maxmaximum index to apply it to in vecMeteo
[in]vecMeteometeo timeseries to process
Returns
true if all missing data points for the given parameter could be generated, false otherwise

Implemented in mio::AllSkyLWGenerator, mio::AllSkySWGenerator, mio::ClearSkyLWGenerator, mio::ClearSkySWGenerator, mio::ConstGenerator, mio::ESOLIPGenerator, mio::HumidityGenerator, mio::IswrAlbedoGenerator, mio::MeteoIndex, mio::PrecSplitting, mio::RadiationComponents, mio::SinGenerator, mio::StandardPressureGenerator, mio::TauCLDGenerator, mio::TsGenerator, and mio::WindComponents.

◆ generate()

◆ getAlgo()

std::string mio::GeneratorAlgorithm::getAlgo ( ) const
inline

◆ getTimeRestrictions()

std::vector< DateRange > mio::GeneratorAlgorithm::getTimeRestrictions ( ) const
inline

◆ initHeightRestrictions()

void mio::GeneratorAlgorithm::initHeightRestrictions ( const std::vector< std::pair< std::string, std::string > >  vecArgs)
protected

◆ initStationSet()

std::set< std::string > mio::GeneratorAlgorithm::initStationSet ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  keyword 
)
staticprotected

◆ parse_args()

virtual void mio::GeneratorAlgorithm::parse_args ( const std::vector< std::pair< std::string, std::string > > &  )
inlineprotectedvirtual

◆ skipHeight()

bool mio::GeneratorAlgorithm::skipHeight ( const double &  height) const

◆ skipStation()

bool mio::GeneratorAlgorithm::skipStation ( const std::string &  station_id) const

Should this station be skipped, based on user-provided station ID restrictions?

Parameters
[in]station_idID of the current station
Returns
true if the provided station ID should be skipped

◆ skipTimeStep()

bool mio::GeneratorAlgorithm::skipTimeStep ( const Date dt) const

Should this timestep be skipped, based on user-provided time restrictions?

Parameters
[in]dtcurrent timestep
Returns
true the provided timestep should be skipped

Member Data Documentation

◆ algo

const std::string mio::GeneratorAlgorithm::algo
protected

◆ all_heights

bool mio::GeneratorAlgorithm::all_heights
protected

◆ default_height

const double mio::GeneratorAlgorithm::default_height = IOUtils::nodata
staticprotected

◆ excluded_heights

std::set<double> mio::GeneratorAlgorithm::excluded_heights
protected

◆ excluded_stations

const std::set<std::string> mio::GeneratorAlgorithm::excluded_stations
protected

◆ included_heights

std::set<double> mio::GeneratorAlgorithm::included_heights
protected

◆ kept_stations

const std::set<std::string> mio::GeneratorAlgorithm::kept_stations
protected

◆ section

const std::string mio::GeneratorAlgorithm::section
protected

◆ snow_albedo

const double mio::GeneratorAlgorithm::snow_albedo = .85
staticprotected

◆ snow_thresh

const double mio::GeneratorAlgorithm::snow_thresh = .1
staticprotected

◆ soil_albedo

const double mio::GeneratorAlgorithm::soil_albedo = .23
staticprotected

◆ time_restrictions

const std::vector<DateRange> mio::GeneratorAlgorithm::time_restrictions
protected

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