earthkit.hydro.river_network

Module contents

earthkit.hydro.river_network.available(data_source='https://api.github.com/repos/ecmwf/earthkit-hydro-store/git', token=None)[source]

Prints the available precomputed networks.

Parameters:
  • data_source (str, optional) – Base github URI to query from.

  • token (str, optional) – Github access token.

earthkit.hydro.river_network.create(path, river_network_format, source='file', use_cache=True, cache_dir=None, cache_fname='{ekh_version}_{hash}.joblib', cache_compression=1)[source]

Creates a river network from the given path, format, and source.

Parameters:
  • path (str) – The path to the river network data. All common file formats are supported such as netCDF, GRIB, GeoTIFF, zarr, etc.

  • river_network_format (str) – The format of the river network data. Supported formats are “precomputed”, “cama”, “pcr_d8”, “esri_d8” and “merit_d8”.

  • source (str) – The source of the river network data. Default is ‘file’. For possible sources see: https://earthkit-data.readthedocs.io/en/latest/guide/sources.html.

  • use_cache (bool, optional) – Whether to cache the loaded/created river network for quicker reloading. Default is True.

  • cache_dir (str, optional) – Where to store the cached river networks. Default is None, which uses tempfile.mkdtemp(suffix=”_earthkit_hydro”).

  • cache_fname (str, optional) – A string template for the cache filename convention.

  • cache_compression (int, optional) – A compression factor for the cached files.

Returns:

The river network object created from the given data.

Return type:

RiverNetwork

earthkit.hydro.river_network.load(domain, river_network_version, data_source='https://github.com/ecmwf/earthkit-hydro-store/raw/refs/heads/main/{ekh_version}/{domain}/{river_network_version}/river_network.joblib', *args, **kwargs)[source]

Load a precomputed river network from a named domain and river_network_version.

Supported networks are as follows:

domain

version

Details

Note

Attribution

“efas”

“5”

1arcmin European

[1]

“efas”

“4”

5km European

Smaller domain than v5

[1]

“glofas”

“4”

3arcmin global

60° South to 90° North

[2]

“glofas”

“3”

6arcmin global

60° South to 90° North

[2]

“cama_03min”

“4”

3arcmin global

[3]

“cama_05min”

“4”

5arcmin global

[3]

“cama_06min”

“4”

6arcmin global

[3]

“cama_15min”

“4”

15arcmin global

[3]

“hydrosheds_05min”

“1”

5arcmin global

56° South to 84° North

[4]

“hydrosheds_06min”

“1”

6arcmin global

56° South to 84° North

[4]

Parameters:
  • domain (str) – The domain of the river network.

  • river_network_version (str) – The version of the river network on the specified domain.

  • data_source (str, optional) – The data source URL template for the river network.

  • *args (tuple) – Additional positional arguments to pass to create_river_network.

  • **kwargs (dict) – Additional keyword arguments to pass to create_river_network.

Returns:

The loaded river network.

Return type:

RiverNetwork

References