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

Update methods around gauges #172

Merged
merged 18 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
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
4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ Setup components
WflowModel.setup_laimaps
WflowModel.setup_soilmaps
WflowModel.setup_hydrodem
WflowModel.setup_outlets
WflowModel.setup_gauges
WflowModel.setup_areamap
WflowModel.setup_config_output_timeseries
WflowModel.setup_precip_forcing
WflowModel.setup_temp_pet_forcing
WflowModel.setup_constant_pars
Expand Down Expand Up @@ -147,8 +149,10 @@ Setup components
WflowSedimentModel.setup_soilmaps
WflowSedimentModel.setup_riverwidth
WflowSedimentModel.setup_riverbedsed
WflowSedimentModel.setup_outlets
WflowSedimentModel.setup_gauges
WflowSedimentModel.setup_areamap
WflowSedimentModel.setup_config_output_timeseries
WflowSedimentModel.setup_constant_pars
WflowSedimentModel.setup_staticmaps_from_raster

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ Unreleased

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']).
- Support in toml for dir_input and dir_output options. `PR #140 <https://github.com/Deltares/hydromt_wflow/pull/140>`_
- 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']).
- 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.
- **setup_oulets**: Add map/geom of basin outlets (on river or all) and optionally updates outputs in toml file.
- **setup_config_output_timeseries**: add new variable/column to the netcf/csv output section of the toml based on a selected gauge/area map.
- **setup_gauges**: support for snapping based on a user defined max distance and snapping based on upstream area attribute.
- **setup_gauges**: gauges_fn can be both GeoDataFrame or GeoDataset (new) data_type.
- 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
Expand All @@ -23,6 +28,7 @@ Changed
- 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.
- in **setup_gauges**: basins outlets are not generated by this function anymore but by the new **setup_outlets** method.
- Update docs of the developer installation guide to use pip install -e . instead of flit.
- Change naming of θₛ, θᵣ and kv₀ to theta_s, theta_r and kv_0 in the toml template of wflow.
- Merged river part of setup_hydrodem into setup_rivers functionality, and moved land part of setup_hydrodem into setup_floodplains.
Expand Down
8 changes: 6 additions & 2 deletions docs/user_guide/sediment_model_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ a specific method see its documentation.
- This component sets the river width parameter based on a power-lay relationship with a predictor.
* - :py:func:`~WflowSedimentModel.setup_riverbedsed`
- Setup sediments based river bed characteristics maps.
* - :py:func:`~WflowSedimentModel.setup_gauges`
- This components sets the default gauge map based on basin outlets and additional gauge maps based on gauges_fn data.
* - :py:func:`~WflowModel.setup_outlets`
- This method sets the default gauge map based on basin outlets.
* - :py:func:`~WflowModel.setup_gauges`
- This method sets the default gauge map based on a gauges_fn data.
* - :py:func:`~WflowModel.setup_areamap`
- Setup area map from vector data to save wflow outputs for specific area.
* - :py:func:`~WflowModel.setup_config_output_timeseries`
- This method add a new variable/column to the netcf/csv output section of the toml based on a selected gauge/area map.
* - :py:func:`~WflowSedimentModel.setup_constant_pars`
- Setup constant parameter maps.
* - :py:func:`~WflowModel.setup_staticmaps_from_raster`
Expand Down
6 changes: 5 additions & 1 deletion docs/user_guide/wflow_model_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ a specific method see its documentation.
- This component derives several (layered) soil parameters based on a database with physical soil properties using available point-scale (pedo)transfer functions (PTFs) from literature with upscaling rulesto ensure flux matching across scales.
* - :py:func:`~WflowModel.setup_hydrodem`
- This component adds a hydrologically conditioned elevation (hydrodem) map for river and/or land local-inertial routing.
* - :py:func:`~WflowModel.setup_outlets`
- This method sets the default gauge map based on basin outlets.
* - :py:func:`~WflowModel.setup_gauges`
- This method sets the default gauge map based on basin outlets and additional gauge maps based on gauges_fn data.
- This method sets the default gauge map based on a gauges_fn data.
* - :py:func:`~WflowModel.setup_areamap`
- Setup area map from vector data to save wflow outputs for specific area.
* - :py:func:`~WflowModel.setup_config_output_timeseries`
- This method add new variable/column to the netcf/csv output section of the toml based on a selected gauge/area map.
* - :py:func:`~WflowModel.setup_precip_forcing`
- Setup gridded precipitation forcing at model resolution.
* - :py:func:`~WflowModel.setup_temp_pet_forcing`
Expand Down
3 changes: 3 additions & 0 deletions examples/wflow_build.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ lai_fn = modis_lai # source for LAI: {modis_lai}
soil_fn = soilgrids # source for soilmaps: {soilgrids}
ptf_ksatver = brakensiek # pedotransfer function to calculate hydraulic conductivity: {brakensiek, cosby}

[setup_outlets]
river_only = True

[setup_gauges]
gauges_fn = grdc # if not None add gaugemap. Either a path or known gauges_fn: {grdc}
snap_to_river = True # if True snaps gauges from source to river
Expand Down
3 changes: 3 additions & 0 deletions examples/wflow_sediment_build.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ canopy_fn = simard # source for vegetation canopy height: {sima
soil_fn = soilgrids # source for soilmaps: {soilgrids}
usleK_method = renard # method to compute the USLE K factor: {renard, epic}

[setup_outlets]
river_only = True

[setup_gauges]
gauges_fn = grdc # If not None add gaugemap. Either a path or known gauges_fn: {grdc}
snap_to_river = True # If True snaps gauges from source to river
Expand Down
24 changes: 1 addition & 23 deletions hydromt_wflow/data/wflow/wflow_sbm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ path_forcing = "inmaps.nc"
path_static = "staticmaps.nc"

# these are not directly part of the model
gauges = "wflow_gauges"
ldd = "wflow_ldd"
river_location = "wflow_river"
subcatchment = "wflow_subcatch"
Expand Down Expand Up @@ -127,29 +126,8 @@ thicknesslayers = [100, 300, 800]
[output]
path = "output.nc"

#[output.vertical]
#satwaterdepth = "satwaterdepth"
#snow = "snow"
#tsoil = "tsoil"
#ustorelayerdepth = "ustorelayerdepth"
#snowwater = "snowwater"
#canopystorage = "canopystorage"

[output.lateral.river]
q_av = "q_river"
#h = "h_river"

#[output.lateral.subsurface]
#ssf = "ssf"

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

[csv]
path = "output.csv"

[[csv.column]]
header = "Q"
map = "gauges"
parameter = "lateral.river.q_av"
path = "output.csv"
8 changes: 1 addition & 7 deletions hydromt_wflow/data/wflow_sediment/wflow_sediment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ path_forcing = "inmaps.nc"
path_static = "staticmaps.nc"

# these are not directly part of the model
gauges = "wflow_gauges"
ldd = "wflow_ldd"
river_location = "wflow_river"
subcatchment = "wflow_subcatch"
Expand Down Expand Up @@ -136,9 +135,4 @@ soilloss = "soilloss"
SSconc = "SSconc"

[csv]
path = "output.csv"

[[csv.column]]
header = "TSS"
map = "gauges"
parameter = "lateral.river.SSconc"
path = "output.csv"