import numpy
import evalhyd
An error occurred while loading the file. Please try again.
-
Dorchies David authored
- All remarks #43 (comment 40117) taken into account - fix bugs in vignettes after fc016f26 Refs #43, #52
b28c8d6f
evalhyd-python
demonstration
Deterministic evaluation
Define streamflow observations
# shape: {1, time: 4}
obs = numpy.array(
[[4.7, 4.3, 5.5, 2.7]]
)
Define streamflow predictions
# shape: {series: 1, time: 4}
prd = numpy.array(
[[5.3, 4.2, 5.7, 2.3]]
)
Compute Nash-Sutcliffe efficiency
# shape: {series: 1, subsets: 1, samples: 1}
evalhyd.evald(obs, prd, ["NSE"])
Probabilistic evaluation
Define streamflow observations
# shape: {sites: 1, time: 5}
obs = numpy.array(
[[4.7, 4.3, 5.5, 2.7, 4.1]]
)
Define streamflow predictions
# shape: {sites: 1, lead times: 1, members: 3, time: 5}
prd = numpy.array(
[[[[5.3, 4.2, 5.7, 2.3, 3.1],
[4.3, 4.2, 4.7, 4.3, 3.3],
[5.3, 5.2, 5.7, 2.3, 3.9]]]]
)
Define streamflow thresholds
# shape: {sites: 1, thresholds: 2}
thr = numpy.array(
[[4., 5.]]
)
Compute Brier score
# shape: {sites: 1, lead times: 1, subsets: 1, samples: 1, thresholds: 2}
evalhyd.evalp(obs, prd, ["BS"], thr, events="high")