Deltares / hydromt_wflow

Wflow plugin for HydroMT
https://deltares.github.io/hydromt_wflow/
GNU General Public License v3.0
15 stars 12 forks source link

setup_rivers does not update river width and depth #283

Open shartgring opened 2 weeks ago

shartgring commented 2 weeks ago

HydroMT-Wflow version checks

Reproducible Example

Using setup_rivers() to update a model in a Python script does not update all parameter maps. For example, updating river maps with upa=100 to upa=5, resulting in a larger river map, but the wflow_riverwidth and RiverDepth map still only has width values for the cells created by upa=100 and not upa=5

staticmaps.zip

Current behaviour

Does not update river width and depth when upa is changes

Desired behaviour

Update river width and depth for all new river cells, not old ones

Additional context

No response

shartgring commented 2 weeks ago

Looked into it and think I know what it causing it, will try to fix it myself this week. I think someway in which attribute columns in the gdf are checked and parts in the order/checking of the code are made to work with building models, not updating

shartgring commented 2 weeks ago

I found what was causing it, also partly an error (typo) from my side. When river_geom_fn is not specified but a model does already contain a river depth and width, the river depth and width maps are not added, so the old width and depth maps remain. What would be desired behaviour, to remove the old width and depth maps when setup_rivers is called.

Or add a width and depth map when river_geom_fn is not specified with the minimum depth and widths? I think this makes sense, and that map then automatically gets the same mask as the river, preventing that these is a mismatch between the number of river cells when a model is updated