-
Notifications
You must be signed in to change notification settings - Fork 16
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
Interpolation of point forcing data (station-based) using wradlib #315
Conversation
Allright! After some work the code looks good. Only thing to improve is how the gauge stations are loaded. That code is now copied from setup_gauges, but it can be cleaner and the implementation of the GeoDataset can be improved (linking it to precip_fn and not the stations). The idea is to leave this PR as a draft as MetPy functionality is not working for natural neighbor and Cressman. It would make sense to switch to https://docs.wradlib.org/en/latest/. However, this will not work with the xarray requirement, and to get rid off the pin we need to upgrade to HydroMT version 1.0. Therefore, the PR will be a draft until we know more about the update to version 1.0. |
Replaced metpy with wradlib now that newer xarray versions are supported :) Tests are passing and all interpolation methods work fine so looks like it is ready for review |
I have included it 👍 |
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.
Very nice improvements @shartgring ! This will definitely become a useful function I think.
I have a few comments mostly on documentation.
And to keep in with the docs, you should not forget to add this function to the hydromt_wflow docs itself :) There are two places for that: api.rst (both for the wflow function and the new forcing workflow) and then update the table for all setup methods for wflow in user_guide/wflow_model_setup.rst
hydromt_wflow/wflow.py
Outdated
interp_type: str = "nearest", | ||
precip_stations_fn: Optional[Union[str, gpd.GeoDataFrame]] = None, | ||
index_col: Optional[str] = None, | ||
buffer: int = 100, |
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 was maybe not clear but I did check in hydromt and the buffer argument for get_geodataset
and get_geodataframe
is in meters. So we should update the default value and the docs here.
Co-authored-by: hboisgon <[email protected]>
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.
Great thanks a lot for the updates! It's good to go now :)
Issue addressed
Fixes #312
Explanation
Consists of a part in wflow.py for reading and checking the forcing data and station data, and a new workflow in workflow/forcing.py where interpolation takes place.
Checklist
main
Additional Notes
Interpolation types not working in tests
01-04-2025: replaced metpy with wradlib