Skip to content

Commit

Permalink
use hydromt v0.7.2.dev for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkEilander committed Jul 10, 2023
1 parent 70b7f51 commit 10c04e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion envs/hydromt-sfincs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ dependencies:
- sphinx # docs
- xarray
- pip:
- sphinx_design # docs
- sphinx_design # docs
- git+https://github.com/Deltares/hydromt.git # bathymetry.burn_river_rect requires v0.7.2
5 changes: 4 additions & 1 deletion hydromt_sfincs/workflows/bathymetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ def burn_river_rect(
da_elv1 = da_elv.raster.mask_nodata()
da_elv1 = da_elv1.where(np.isnan(ds[rivdph_name]), np.nan)
da_elv1.raster.set_nodata(np.nan)
# extrapolate requires HydroMT v0.7.2(!)
da_elv1 = da_elv1.raster.interpolate_na(method="linear", extrapolate=True)
# subtract river depth from interpolated river bank elevation
da_elv1 = da_elv1 - ds[rivdph_name].fillna(0)
Expand All @@ -608,6 +609,8 @@ def burn_river_rect(

# update manning:
if "manning" in ds and da_man is not None:
da_man = da_man.where(np.isnan(ds["manning"]), ds["manning"])
da_man = da_man.where(
np.logical_or(np.isnan(ds["manning"]), ds["manning"] <= 0), ds["manning"]
)

return da_elv, da_man

0 comments on commit 10c04e1

Please sign in to comment.