Generate precipitation phase or splitting according to the selected method.
In order to handle solid and liquid precipitation, there are two possibilities: either as total amount and phase (respectively "PSUM" and "PSUM_PH") or as solid and liquid amounts (respectively "PSUM_S" and "PSUM_L"). This generator can convert from one representation to the other one or generate the missing components (for example, the precipitation phase associated with a given precipitation amout based on a splitting model).
The component that will be generated depends on the parameter name, so only the following parameters are supported: PSUM, PSUM_PH, PSUM_L, PSUM_S. Whenever a component is missing, a splitting model is called to compute the splitting. It is therefore recommended to configure a splitting model.
It takes the following arguments:
For example, to generate the precipitation phase when only the precipitation amout is available, using a simple temperature threshold for doing the splitting:
To generate the liquid and solid amounts from the precipitation sum and phase, relying on a simple temperature threshold for the splitting (if the precipitation phase is available, it will be used instead of calling the splitting model):
To generate the precipitation sum and phase from the liquid and solid amounts without any fallback algorithm for the splitting:
#include <PrecSplitting.h>
Public Member Functions | |
PrecSplitting (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_section, const double &TZ) | |
bool | generate (const size_t ¶m, MeteoData &md, const std::vector< MeteoData > &vecMeteo) |
bool | create (const size_t ¶m, const size_t &ii_min, const size_t &ii_max, std::vector< MeteoData > &vecMeteo) |
Fill one time series of MeteoData for one station. More... | |
Public Member Functions inherited from mio::GeneratorAlgorithm | |
virtual | ~GeneratorAlgorithm () |
virtual bool | generate (const size_t ¶m, MeteoData &md, const std::vector< MeteoData > &vecMeteo)=0 |
virtual bool | create (const size_t ¶m, 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< DateRange > | getTimeRestrictions () const |
std::string | getAlgo () const |
Additional Inherited Members | |
Protected Member Functions inherited from 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 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 inherited from mio::GeneratorAlgorithm | |
static std::set< std::string > | initStationSet (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &keyword) |
Protected Attributes inherited from mio::GeneratorAlgorithm | |
const std::vector< DateRange > | time_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 inherited from mio::GeneratorAlgorithm | |
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 |
|
inline |
|
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.
[in] | param | meteo parameter to generate |
[in] | ii_min | minimum index to apply it to in vecMeteo |
[in] | ii_max | maximum index to apply it to in vecMeteo |
[in] | vecMeteo | meteo timeseries to process |
Implements mio::GeneratorAlgorithm.
|
virtual |
Implements mio::GeneratorAlgorithm.