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

Use time series to create forcing files #312

Open
shartgring opened this issue Dec 9, 2024 · 4 comments · May be fixed by #315
Open

Use time series to create forcing files #312

shartgring opened this issue Dec 9, 2024 · 4 comments · May be fixed by #315
Assignees
Labels
enhancement New feature or request setup methods Issue related to existing or new setup methods workflows Issue linked to the workflows

Comments

@shartgring
Copy link
Collaborator

shartgring commented Dec 9, 2024

Kind of request

Possible enhancement of setup_precip_forcing, or alternatively a new feature. I am working on this in a branch as part of making things easier for stress-testing and model coupling

Enhancement Description

Currently, only gridded data can be used to create forcing files. In some cases it can be convenient to create forcing files from timeseries (csv), either uniformly or using interpolation methods

Use case

  • When gridded data does not have the desired coverage or temporal resolution, which can be supplied by multiple local stations
  • When working with uniform design rainfall events (e.g. to compute boundary conditions, stress-testing, climate analysis)

Additional Context

Might this be something that would also fit in HydroMT core?

Would this be something to use as an enhancement of the current setup_precip_forcing (and let it detect if precip_fn refers to gridded data or timeseries), or add it as a new method?

And, which interpolations would be good to include? Thiessen polygons, Inverse Distance Weighting, ... ? Literature might be good source for methods, see for example https://cdn.knmi.nl/knmi/pdf/bibliotheek/knmipubIR/IR2009-04.pdf

@shartgring shartgring added enhancement New feature or request needs refinement issue still needs refinement workflows Issue linked to the workflows setup methods Issue related to existing or new setup methods and removed needs refinement issue still needs refinement labels Dec 9, 2024
@shartgring shartgring self-assigned this Dec 9, 2024
@hboisgon
Copy link
Contributor

It's been on the wishlist for very long and there is an issue open in hydromt core: Deltares/hydromt#101

I would prefer to create a different method, the arguments will be completely different so it would be better to separate I think.
We can start with one interpolation but would be good to have several available even if we implement them later.

@shartgring
Copy link
Collaborator Author

Interpolation docs shared by FEWS team: https://publicwiki.deltares.nl/display/FEWSDOC/Interpolation+Spatial+Transformations

@hboisgon
Copy link
Contributor

hboisgon commented Dec 16, 2024

Create a new hydromt-wflow method and workflow: setup_precip_from_point_timeseries

Steps in the workflow: using metpy

  • Read input data as geodataset - geometry type is point only (we could decide to support vector later)
  • Time resampling
  • Filter the stations with nodata for a specific timestep to leave them out of the interpolation (any other missing treatment eg fill with zeros should be done beforehand)
  • Call the interpolation method from metpy: interpolate_to_grid
  • The method should be wrapped for xarray (ufunc) - (metpy can only be used timestep per timestep)
  • Fill any remaining missings with zero or with other gridded data (nice to have)?
  • Export - write

Note: for later if we decide to support polygon timeseries, we can use xugrid regridding methods to go from mesh/polygon to regular grid

@shartgring
Copy link
Collaborator Author

Alternatively, there is a more precipitation focused package https://docs.wradlib.org/en/latest/ipol.html (thanks @RubenImhoff!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request setup methods Issue related to existing or new setup methods workflows Issue linked to the workflows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants