pywr.parameters.RbfProfileParameter

class pywr.parameters.RbfProfileParameter(model, days_of_year, values, lower_bounds=0.0, upper_bounds=np.inf, rbf_kwargs=None, variable_days_of_year_range=0, min_value=-np.inf, max_value=np.inf, **kwargs)

Parameter which interpolates a daily profile using a radial basis function (RBF).

The daily profile is computed during model reset using a radial basis function with day-of-year as the independent variables. The days of the year are defined by the user alongside the values to use on each of those days for the interpolation. The first day of the years should always be one, and its value is repeated as the 366th value. In addition the second and penultimate values are mirrored to encourage a consistent gradient to appear across the boundary. The RBF calculations are undertaken using the scipy.interpolate.Rbf object, please refer to Scipy’s documentation for more information.

Parameters:
days_of_yeariterable, integer

The days of the year at which the interpolation values are defined. The first value should be one.

valuesiterable, float

Values to use for interpolation corresponding to the days_of_year.

lower_boundsfloat or array_like (default=0.0)

Defines the lower bounds when using optimisation. If a float given, same bound applied for every day of the year. Otherwise an array like object of length equal to the number of days of the year should be given.

upper_boundsfloat or array_like (default=np.inf)

Defines the upper bounds when using optimisation. If a float given, same bound applied for every day of the year. Otherwise an array like object of length equal to the number of days of the year should be given.

variable_days_of_year_rangeint (default=0)

The maximum bounds (positive or negative) for the days of year during optimisation. A non-zero value will cause the days of the year values to be exposed as integer variables (except the first value which remains at day 1). This value is bounds on those variables as maximum shift from the given days_of_year.

min_value, max_valuefloat

Optionally cap the interpolated daily profile to a minimum and/or maximum value. The default values are negative and positive infinity for minimum and maximum respectively.

rbf_kwargs: Optional, dict

Optional dictionary of keyword arguments to base to the Rbf object.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

after(self)

before(self)

finish(self)

get_all_values(self)

get_constant_value(self)

Return a constant value.

get_double_lower_bounds(self)

get_double_upper_bounds(self)

get_double_variables(self)

get_integer_lower_bounds(self)

get_integer_upper_bounds(self)

get_integer_variables(self)

get_value(self, ScenarioIndex scenario_index)

load(cls, model, data)

register(cls)

reset(self)

set_double_variables(self, double[)

set_integer_variables(self, int[)

setup(self)

unregister(cls)

value(self, Timestep ts, ...)

Attributes

children

comment

comment: unicode

days_of_year

double_size

double_size: 'int'

integer_size

integer_size: 'int'

is_constant

is_variable

is_variable: 'bool'

model

name

parents

rbf

rbf: object

rbf_kwargs

rbf_kwargs: object

size

tags

tags: dict

variable_days_of_year_range