Skip to content

Commit

Permalink
include glofas upstream area
Browse files Browse the repository at this point in the history
  • Loading branch information
jensdebruijn committed Sep 24, 2024
1 parent eff3071 commit f773de8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/data_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ glofas_4_0_discharge_yearly:
meta:
version: LISFLOOD 4.0
source_url: https://cds.climate.copernicus.eu/cdsapp#!/dataset/10.24381/cds.ff1aef77?tab=overview
glofas_uparea:
data_type: RasterDataset
path: /scistor/ivm/data_catalogue/hydrology/discharge/uparea_glofas_v4_0.nc
driver: netcdf
crs: 4326
unit_mult:
uparea: 0.000001
meta:
version: LISFLOOD 4.0
source_url: https://cds.climate.copernicus.eu/cdsapp#!/dataset/10.24381/cds.ff1aef77?tab=overview
gcn250:
data_type: RasterDataset
path: /scistor/ivm/data_catalogue/hydrology/soil/gcn_sfincs/{variable}.tif
Expand Down
19 changes: 19 additions & 0 deletions geb/setup/geb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5372,6 +5372,25 @@ def setup_hydrodynamics(
), # hydromt likes absolute paths
)

glofas_uparea = self.data_catalog.get_rasterdataset(
"glofas_uparea",
bbox=bounds,
buffer=1,
variables=["uparea"],
)
glofas_uparea = glofas_uparea.rename({"latitude": "y", "longitude": "x"})
glofas_uparea.name = "uparea"
self.set_forcing(glofas_uparea, name="hydrodynamics/uparea")

hydrodynamics_data_catalog.add_source(
"glofas_uparea",
RasterDatasetAdapter(
path=Path(self.root) / "hydrodynamics" / "uparea.zarr.zip",
meta=self.data_catalog.get_source("glofas_uparea").meta,
driver="zarr",
), # hydromt likes absolute paths
)

# river centerlines
river_centerlines = self.data_catalog.get_geodataframe(
"river_centerlines_MERIT_Basins",
Expand Down

0 comments on commit f773de8

Please sign in to comment.