pywr.recorders.FlowDurationCurveDeviationRecorder

class pywr.recorders.FlowDurationCurveDeviationRecorder(model, AbstractNode node, percentiles, lower_target_fdc=None, upper_target_fdc=None, scenario=None, **kwargs)

This recorder calculates a Flow Duration Curve (FDC) for each scenario and then calculates their deviation from upper and lower target FDCs. The 2nd dimension of the target duration curves and percentiles list must be of the same length and have the same order (high to low values or low to high values).

Deviation is calculated as positive if actual FDC is above the upper target or below the lower target. If actual FDC falls between the upper and lower targets zero deviation is returned.

Parameters:
modelpywr.core.Model
nodepywr.core.Node

The node to record

percentilesarray

The percentiles to use in the calculation of the flow duration curve. Values must be in the range 0-100.

lower_target_fdcarray, optional

The lower FDC against which the scenario FDCs are compared. If values are not provided then deviations from a lower target FDC are recorded as 0.0. If targets are loaded from an external file this needs to be indexed using the percentile values.

upper_target_fdcarray, optional

The upper FDC against which the scenario FDCs are compared. If values are not provided then deviations from a upper target FDC are recorded as 0.0. If targets are loaded from an external file this needs to be indexed using the percentile values.

agg_func: str, optional

Function used for aggregating the FDC deviations across percentiles. Numpy style functions that support an axis argument are supported.

fdc_agg_func: str, optional

Optional different function for aggregating across scenarios.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

after(self)

aggregated_value(self)

before(self)

finish(self)

is_constraint_violated(self)

Returns true if the value from this Recorder violates its constraint bounds.

load(cls, model, data)

register(cls)

reset(self)

setup(self)

to_dataframe(self[, return_fdc])

Return a pandas.DataFrame of the deviations from the target FDCs

unregister(cls)

values(self)

Compute a value for each scenario using temporal_agg_func.

Attributes

agg_func

children

comment

comment: unicode

constraint_lower_bounds

constraint_upper_bounds

data

epsilon

epsilon: 'double'

factor

factor: 'float'

fdc

fdc_deviations

ignore_nan

ignore_nan: 'bool'

is_constraint

Returns true if either upper or lower constraint bounds is defined.

is_double_bounded_constraint

Returns true if upper and lower constraint bounds are both defined and not-equal to one another.

is_equality_constraint

Returns true if upper and lower constraint bounds are both defined and equal to one another.

is_lower_bounded_constraint

Returns true if lower constraint bounds is defined and upper constraint bounds is not.

is_objective

is_upper_bounded_constraint

Returns true if upper constraint bounds is defined and lower constraint bounds is not.

model

name

node

parents

scenario

scenario: pywr._core.Scenario

tags

tags: dict

temporal_agg_func