Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Deltares/hydromt_sfincs int…
Browse files Browse the repository at this point in the history
…o v2/quadtree
  • Loading branch information
roeldegoede committed Sep 16, 2024
2 parents f3aa977 + efd7a78 commit 679b153
Show file tree
Hide file tree
Showing 26 changed files with 1,176 additions and 461 deletions.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ SFINCS workflows
workflows.merge_dataarrays
workflows.burn_river_rect
workflows.snap_discharge
workflows.river_boundary_points
workflows.river_source_points
workflows.river_centerline_from_hydrography
workflows.landuse
workflows.cn_to_s
Expand Down
33 changes: 33 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@ Distinction is made between new methods (Added), changes to existing methods (Ch
The format is based on `Keep a Changelog`_, and this project adheres to
`Semantic Versioning`_.

v1.1.0 (05-09-2024)
===================
**This release contains some breaking changes and can only be used in combination with
`SFINCS versions ≥ 2.1.1 <https://github.com/Deltares/SFINCS/releases/tag/v2.1.1_Dollerup_release>`_.**

The most important change is the implementation of a new subgrid methodology including wet fraction as in Van Ormondt et al. (2024, in review),
which is now written as a NetCDF file! The old implementation is still available when providing the original binary file, but then all wet fractions are assumed to be 1.

Next to this, some minor additions and bugfixes are made that improve the overall functionality of the package.

Added
-----
- improved subgrid tables that account for the wet fraction of the cell (#160)
- add source points at headwater locations with `SfincsModel.setup_river_inflow` (#170)
- it's now possible to provide a format/precision in `SfincsModel.write_forcing` (#197)
- river bed levels for burn-in can now be provided at point locations in `SfincsModel.setup_subgrid` (#209)

Changed
-------
- improved subgrid tables are saved as NetCDF (#160)
- improved weighting of adjacent cells in u/v points for determining representative Manning roughness and conveyance depth (#200)
- In `SfincsModel.setup_river_inflow`, in case of a confluence within a user-defined buffer of the
model boundary, the confluence rather than both tributaries is selected as inflow point. (#202)
- turned on "baro", the atmospheric pressure term in the momentum equation, in sfincs.inp by default (#208)
- the expected variable names for wind and pressure forcing have been changed to "wind10_u", "wind10_v" and "press_msl" to match hydromt-core conventions (#211)

Fixed
-----
- rounding errors in `workflows.tile_window` which resulted in erronuous slippy-tiles (#178)
- "active geometry column to use has not been set" error for GeoDataFrame (#180)
- added nodata value to raster before writing (#199)


v1.0.3 (3 January 2024)
=======================
This release contains several changes and fixes. Most notably, models with a geographical CRS can now be build.
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/sfincs_build_update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ See `Example: Build from Script <../_examples/build_from_script.ipynb>`_ for a m
Example: Build from CLI <../_examples/build_from_cli.ipynb>
Example: Build from script <../_examples/build_from_script.ipynb>
Example: Setup model forcing <../_examples/example_forcing.ipynb>
Example: Working with data <../_examples/example_datasources.ipynb>
.. Example: Working with data <../_examples/example_datasources.ipynb>
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- descartes # to run examples
- ffmpeg # to run examples (animation)
# - git
- hydromt>=0.8.0
- hydromt_sfincs>=1.0
- hydromt>=0.10.0, <0.11
- hydromt_sfincs>=1.1.0
- jupyterlab # to run examples
- matplotlib # to run examples
- pip
Expand Down
4 changes: 2 additions & 2 deletions envs/hydromt-sfincs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
- cartopy
- descartes
- ffmpeg
- geopandas>=0.8
- hydromt>=0.9.1
- geopandas>=1.0
- hydromt>=0.10, <0.11
- jupyterlab
- matplotlib
- nbsphinx
Expand Down
2 changes: 1 addition & 1 deletion hydromt_sfincs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os.path import dirname, join, abspath


__version__ = "1.0.3"
__version__ = "1.1.0"

DATADIR = join(dirname(abspath(__file__)), "data")

Expand Down
8 changes: 4 additions & 4 deletions hydromt_sfincs/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def plot_forcing(forcing: Dict, **kwargs):
df.plot(drawstyle="steps", ax=axes[i])
elif (
name.startswith("press")
or name.startswith("wind_u")
or name.startswith("wind_v")
or name.startswith("wind10_u")
or name.startswith("wind10_v")
):
df.plot.line(ax=axes[i])
elif name.startswith("wnd"):
Expand Down Expand Up @@ -258,8 +258,8 @@ def plot_basemap(
dx, dy = da.raster.res
_rgb = ls.shade(
da.fillna(0).values,
norm=kwargs["norm"],
cmap=kwargs["cmap"],
norm=kwargs0["norm"],
cmap=kwargs0["cmap"],
blend_mode="soft",
dx=dx,
dy=dy,
Expand Down
4 changes: 1 addition & 3 deletions hydromt_sfincs/regulargrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ def empty_mask(self) -> xr.DataArray:
def ind(self, mask: np.ndarray) -> np.ndarray:
"""Return indices of active cells in mask."""
assert mask.shape == (self.nmax, self.mmax)
iok = np.where(np.transpose(mask) > 0)
iok = (iok[1], iok[0])
ind = np.ravel_multi_index(iok, (self.nmax, self.mmax), order="F")
ind = np.where(mask.ravel(order="F"))[0]
return ind

def write_ind(
Expand Down
Loading

0 comments on commit 679b153

Please sign in to comment.