-
Notifications
You must be signed in to change notification settings - Fork 15
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
ENH: added setup_storage_volume to account for green-infratructure #101
Conversation
…o storage_volume
…o storage_volume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just checked the code, not actually tested it.
Apart from some small comments, before merging, it would be good to
- move the lines 1611-1691 to a workflow script
- add a unit test with a gdf containing a point a polygon with and without volume/height attributes on a small rotated grid to make sure it works as expected.
hydromt_sfincs/sfincs.py
Outdated
# rotate the point | ||
x, y = ~da_vol.raster.transform * (x, y) | ||
# select the grid cell nearest to the point | ||
closest_point = da_vol.reindex(x=da_vol.x, y=da_vol.y).sel( | ||
x=x, y=y, method="nearest" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be replaced with row,col = da_vol.raster.rowcol(x, y)
after which you can use da_vol.iloc[row, col] later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to work for me ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work on the test Roel, looks good to me!
added an additional layer to the SfincsModel.grid to account for green-infrastructure. This layer describes a storage volume in m3 per cell that needs to be filled first before the cell becomes wet, and therefore mimics the presence of green-infrastructure.
input can be