Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setup_river_floodplain method #123

Merged
merged 24 commits into from May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
edcbafb
add setup_river_floodplain method
DirkEilander Nov 9, 2022
5d52816
add toml update; add method to docs
DirkEilander Nov 9, 2022
70dce04
add setup_river_floodplain and update toml and staticmaps
laurenebouaziz Feb 9, 2023
41ab4eb
Merge branch 'main' into river_floodplain
DirkEilander Feb 22, 2023
c91b945
fix check on min floodplain volume
DirkEilander Feb 22, 2023
015f590
remove rounding
DirkEilander Feb 24, 2023
634f23e
new setup_floodplains method; remove setup_hydrodem
JoostBuitink Mar 20, 2023
2342182
Merge branch 'main' into river_floodplain
JoostBuitink Mar 20, 2023
3c5085c
fix tests; update example model
JoostBuitink Mar 20, 2023
de2a19d
fix toml for testing
JoostBuitink Mar 21, 2023
d915ada
update example models; fix tests
JoostBuitink Mar 21, 2023
ad791fd
update test env
JoostBuitink Mar 21, 2023
1b83dd6
Update test_env.yml
JoostBuitink Mar 22, 2023
d99fd86
black formatting
JoostBuitink Mar 22, 2023
0b9140e
update pyflwdir versions
JoostBuitink Mar 24, 2023
99b8a24
setup_river pars to attrs, and use in setup_floodplains
JoostBuitink Mar 24, 2023
a80c8e6
bugfix different flood_depth values
JoostBuitink Mar 24, 2023
f480d70
improve river and floodplain tests
JoostBuitink Mar 27, 2023
7fa37c2
Merge branch 'main' into river_floodplain
JoostBuitink Mar 27, 2023
0eadaa2
update setup_floodplain docstring
JoostBuitink May 22, 2023
48c77a0
update docs and changelog
JoostBuitink May 22, 2023
7f9909e
fix glacier map for tests
JoostBuitink May 23, 2023
623082d
Merge branch 'main' into river_floodplain
JoostBuitink May 25, 2023
c9a62a4
Update wflow_build.ini
JoostBuitink May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api.rst
Expand Up @@ -30,6 +30,7 @@ Setup components
WflowModel.setup_config
WflowModel.setup_basemaps
WflowModel.setup_rivers
WflowModel.setup_floodplains
WflowModel.setup_lakes
WflowModel.setup_reservoirs
WflowModel.setup_glaciers
Expand Down
19 changes: 11 additions & 8 deletions docs/changelog.rst
Expand Up @@ -14,12 +14,15 @@ Added
- Support in toml for dir_input and dir_output options. `PR #140 <https://github.com/Deltares/hydromt_wflow/pull/140>`_
- In **setup_reservoirs**: Global Water Watch compatibility for determining reservoir parameters.
- In **setup_reservoirs**: All dowloaded reservoir timeseries are saved to root in 1 csv file. Column headers indicate reservoir id.
- New **setup_floodplains** method, that allows the user the choose either 1D or 2D floodplains. Note: requires pyflwdir v0.5.7. `PR #123 <https://github.com/Deltares/hydromt_wflow/pull/123>`_

Changed
-------
- Default tomls are now using the dir_output option to specify *run_default* folder.
- in **setup_reservoirs**: options 'usehe' and 'priorityjrc' are removed and replaced with 'timeseries_fn'. Options are ['jrc', 'gww']. By default None to use reservoir_fn data directly.
- in **setup_areamap**: name of the added map is based on column name of the vector data (col2raster) instead of name of the vector data file (area_fn). Allows to add several maps from one vector data file.
- in **setup_areamap**: name of the added map is based on column name of the vector data (col2raster) instead of name of the vector data file (area_fn). Allows to add several maps from one vector data file.
- Merged river part of setup_hydrodem into setup_rivers functionality, and moved land part of setup_hydrodem into setup_floodplains.
- in **setup_rivers**, the value used for river_upa is now added as attribute to the rivmsk layer. This value can then be used in the **setup_floodplains** method.

Fixed
-----
Expand All @@ -28,18 +31,18 @@ Fixed
- fix error in **setup_reservoirs** when gdf contains no data in np.nanmax calculation for i.e. damheight #35
- write_forcing with time cftime.DatetimeNoLeap #138 by removing slicing forcing if missings (not needed)
- write_forcing automatic adjustment of starttime and endtime based on forcing content
- When clipping a model from a model with multiple forcing files, a single netcdf is made in write_forcing and the * is removed from the filename.
- When clipping a model from a model with multiple forcing files, a single netcdf is made in write_forcing and the * is removed from the filename.

Deprecated
----------
JoostBuitink marked this conversation as resolved.
Show resolved Hide resolved

- The **setup_hydrodem** function has been removed, and the functionality are moved to **setup_rivers** and **setup_floodplains**
Added
^^^^^
- add options to calculate daily Penman-Monteith potential evaporation using the pyet package. Depending on the available variables, two options are defined ``penman-monteith_tdew`` (inputs: ['temp', 'temp_min', 'temp_max', 'wind_u', 'wind_v', 'temp_dew', 'kin', 'press_msl']) and ``penman-monteith_rh_simple`` (inputs: ['temp', 'temp_min', 'temp_max', 'wind', 'rh', 'kin']).

v0.2.1 (22 November 2022)
=========================
New setup_staticmaps_from_raster method and river smoothing algorithm. Correct some bugs linked to soon
New setup_staticmaps_from_raster method and river smoothing algorithm. Correct some bugs linked to soon
deprecated staticmaps and staticgeoms objects in hydromt core to work with the new 0.6.0 release.

Added
Expand All @@ -50,7 +53,7 @@ Added
Changed
-------
- update forcing example with multiple forcing files #122
- New window smoothing algorithm in `setup_rivers` to avoid cells with small river length.
- New window smoothing algorithm in `setup_rivers` to avoid cells with small river length.
Set the min_rivlen_ratio argument to a value larger than zero to apply the smoothing.
Note: requires pyflwdir v0.5.6 `PR #92 <https://github.com/Deltares/hydromt_wflow/pull/92>`_

Expand All @@ -63,7 +66,7 @@ Fixed
- bug in self.rivers if no staticgeoms and rivmsk is found #113
- bug in wflow_build_sediment.ini template in examples
- wrong defaults in wflow_build.ini teamplate in examples #116
- temporary fix to update staticgeoms basins+rivers in clip_staticmaps (update when moving away from deprecated staticgeoms).
- temporary fix to update staticgeoms basins+rivers in clip_staticmaps (update when moving away from deprecated staticgeoms).
- fix wrong default value for lai_fn in setup_laimaps #119

Deprecated
Expand Down Expand Up @@ -111,7 +114,7 @@ Added
-----
- Possibility to write_forcing in several files based on time frequency (fn_freq argument).
- setup_hydrodem method for hydrological conditioned elevation used with "local-inertial" routing
- workflow.river.river_bathymetry method to derive river width and depth estimates.
- workflow.river.river_bathymetry method to derive river width and depth estimates.
Note that the new river width estimates are different and result in different model results.
- moved basemaps workflows (hydrography and topography) from HydroMT core. Note that HydroMT_Wflow v0.1.3 there should be used together with HydroMT v0.4.4 (not newer!)
- new ID columns for the outlets staticgeoms
Expand Down Expand Up @@ -158,7 +161,7 @@ Added
-----

- Add results attributes for Wflow and read_results method (including test+example).
- Add `f_` parameter in soilgrids
- Add `f_` parameter in soilgrids
- Support soilgrids version 2020
- Setup_areamap component to prepare maps of areas of interest to save Wflow outputs at.
- Support Wflow_sediment with vito landuse.
Expand Down
2 changes: 2 additions & 0 deletions docs/user_guide/wflow_model_setup.rst
Expand Up @@ -38,6 +38,8 @@ a specific method see its documentation.
- This component sets the region of interest and res (resolution in degrees) of the model.
* - :py:func:`~WflowModel.setup_rivers`
- This component sets the all river parameter maps.
* - :py:func:`~WflowModel.setup_floodplains`
This component This components adds floodplain information to the model schematization (can be either 1D or 2D).
* - :py:func:`~WflowModel.setup_lakes`
- This component generates maps of lake areas and outlets as well as parameters with average lake area, depth a discharge values.
* - :py:func:`~WflowModel.setup_reservoirs`
Expand Down
4 changes: 2 additions & 2 deletions envs/hydromt-wflow-min.yml
Expand Up @@ -11,11 +11,11 @@ dependencies:
- netcdf4
- numpy
- pandas
- pyflwdir>=0.5.6
- pyflwdir>=0.5.7
- rasterio
- rioxarray
- scipy
- toml
- xarray


2 changes: 1 addition & 1 deletion envs/hydromt-wflow.yml
Expand Up @@ -29,7 +29,7 @@ dependencies:
- pcraster # optional
- pip
- pydata-sphinx-theme # docs
- pyflwdir>=0.5.4
- pyflwdir>=0.5.7
- pyproj
- pytest # tests
- pytest-cov # tests
Expand Down
3 changes: 1 addition & 2 deletions envs/test_env.yml
Expand Up @@ -23,7 +23,7 @@ dependencies:
- packaging
- pcraster # optional
- pip
- pyflwdir>=0.5.4
- pyflwdir>=0.5.7
- pyproj
- pytest # tests
- pytest-cov # tests
Expand All @@ -46,4 +46,3 @@ dependencies:
- hydroengine
- gwwapi
- git+https://github.com/Deltares/hydromt.git

16 changes: 11 additions & 5 deletions examples/wflow_build.ini
Expand Up @@ -8,7 +8,7 @@ input.path_forcing = inmaps-era5-2010.nc
hydrography_fn = merit_hydro # source hydrography data {merit_hydro, merit_hydro_1k}
basin_index_fn = merit_hydro_index # source of basin index corresponding to hydrography_fn
upscale_method = ihu # upscaling method for flow direction data, by default 'ihu'
res = 0.00833 # build the model at a 30 arc sec (~1km) resolution
res = 0.00833 # build the model at a 30 arc sec (~1km) resolution

[setup_rivers]
hydrography_fn = merit_hydro # source hydrography data, should correspond to hydrography_fn in setup_basemaps
Expand All @@ -19,11 +19,17 @@ min_rivdph = 1 # minimum river depth [m]
min_rivwth = 30 # minimum river width [m]
slope_len = 2000 # length over which tp calculate river slope [m]
smooth_len = 5000 # length over which to smooth river depth and river width [m]
# river_routing = local-inertial # {'kinematic-wave', 'local-inertial'}

# [setup_floodplains] # if 2D floodplains are required
# hydrography_fn = merit_hydro # source hydrography data, should correspond to hydrography_fn in setup_basemaps
# floodplain_type = 2d # # If two-dimensional floodplains are required
# elevtn_map = wflow_dem # {'wflow_dem', 'dem_subgrid'}

# [setup_floodplains] # if 1D floodplains are required
# floodplain_type = 1d # If one-dimensional floodplains are required
# flood_depths = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0] # flood depths at which a volume is derived

# [setup_hydrodem] # uncomment for river and/or land local-inertial routing.
# elevtn_map = dem_subgrid # {'dem_subgrid', 'wflow_dem'}
# river_routing = local-inertial # {'kinematic-wave', 'local-inertial'}
# land_routing = kinematic-wave # {'kinematic-wave', 'local-inertial'}

[setup_reservoirs]
reservoirs_fn = hydro_reservoirs # source for reservoirs shape and attributes
Expand Down
Binary file modified examples/wflow_piave_clip/staticmaps.nc
Binary file not shown.
9 changes: 3 additions & 6 deletions examples/wflow_piave_clip/wflow_sbm.toml
Expand Up @@ -33,8 +33,7 @@ kin_wave_iteration = true
kw_river_tstep = 900
kw_land_tstep = 3600
thicknesslayers = [ 100, 300, 800,]
river_routing = "local-inertial"
land_routing = "local-inertial"
river_routing = "kinematic-wave"

[output]
path = "output.nc"
Expand Down Expand Up @@ -113,29 +112,27 @@ ssf = "ssf"
[state.lateral.land]
h = "h_land"
h_av = "h_av_land"
qx = "qx_land"
qy = "qy_land"
q = "q_land"

[input.lateral.river]
length = "wflow_riverlength"
n = "N_River"
slope = "RiverSlope"
width = "wflow_riverwidth"
bankfull_depth = "RiverDepth"
bankfull_elevation = "hydrodem_avg_D4"

[input.lateral.subsurface]
ksathorfrac = "KsatHorFrac"

[input.lateral.land]
n = "N"
slope = "Slope"
elevation = "hydrodem_avg_D4"

[output.lateral.river]
q_av = "q_river"

[output.lateral.land]
q = "q_land"
h = "h_land"

[input.lateral.river.reservoir]
Expand Down
Binary file modified examples/wflow_piave_subbasin/staticmaps.nc
Binary file not shown.
9 changes: 3 additions & 6 deletions examples/wflow_piave_subbasin/wflow_sbm.toml
Expand Up @@ -33,8 +33,7 @@ kin_wave_iteration = true
kw_river_tstep = 900
kw_land_tstep = 3600
thicknesslayers = [ 100, 300, 800,]
river_routing = "local-inertial"
land_routing = "local-inertial"
river_routing = "kinematic-wave"

[output]
path = "output.nc"
Expand Down Expand Up @@ -113,29 +112,27 @@ ssf = "ssf"
[state.lateral.land]
h = "h_land"
h_av = "h_av_land"
qx = "qx_land"
qy = "qy_land"
q = "q_land"

[input.lateral.river]
length = "wflow_riverlength"
n = "N_River"
slope = "RiverSlope"
width = "wflow_riverwidth"
bankfull_depth = "RiverDepth"
bankfull_elevation = "hydrodem_avg_D4"

[input.lateral.subsurface]
ksathorfrac = "KsatHorFrac"

[input.lateral.land]
n = "N"
slope = "Slope"
elevation = "hydrodem_avg_D4"

[output.lateral.river]
q_av = "q_river"

[output.lateral.land]
q = "q_land"
h = "h_land"

[state.lateral.river.reservoir]
Expand Down