[1]:
import earthkit.hydro as ekh
import numpy as np
network = ekh.river_network.load("efas", "5", use_cache=False)
Cache disabled.
Catchment statistics¶
Instead of computing upstream statistics over an entire field, it is possible to compute statistics just at specific locations of interest. All metrics are available.
[2]:
field = np.ones(network.shape) # or load array/xarray from file
ekh.catchments.sum(network, field, locations = {
"gauge_1": (70.475, 28.32),
"gauge_2": (42.225, 50.24)
})
[2]:
<xarray.DataArray 'out' (node_index: 2)> Size: 16B
array([ 13372., 545096.])
Coordinates:
* node_index (node_index) int64 16B 26066 4153831
lat (node_index) float64 16B 28.32 50.24
lon (node_index) float64 16B 70.47 42.23
name (node_index) <U7 56B 'gauge_1' 'gauge_2'