Add Hydrology Tools
- [ ] Flow Direction: https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/how-flow-direction-works.htm
- [ ] Fill Depressions: https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/creating-a-depressionless-dem.htm
- [ ] Flow Accumulation: https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/how-flow-accumulation-works.htm
- [ ] Delineate watershed: https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/watershed.htm
Also see https://github.com/pangeo-data/pangeo/issues/707 for interested parties who could test and evaluate this functionality.
@thuydotm let's add these to a new module called xrspatial/hydro.py
@brendancol @thuydotm Is there any progress made on these? I'd like to take a stab; watershed delineation is one of the more painful parts of my workflow.
@chase-dwelle that would be great. These have been sitting for a bit and would love for somebody and can help with testing
@brendancol Is there an existing policy on using other libraries? I found pysheds [0], which looks like it would fit the bill for this.
[0] https://github.com/mdbartos/pysheds
I've been working a while ago on this library: https://gitext.gfz-potsdam.de/sec55-public/xarray-topo, which already implements the hydrological processing features mentioned here. It could be a good starting point for addition in xarray-spatial since it only depends on numpy/numba. I might find some time to submit PRs.
Dask support for those functions may be tricky, though, as parallelized versions of those algorithms are not trivial.
@benbovy This sounds great! So exciting.
@chase-dwelle has also been looking at the Hydrology toolset.
We can also brainstorm on the best parts to inject Dask and CuPy into the tools.
Thanks for your comments and let's connect sometime to discuss
Hi folks!
I just talked to @brendancol about adding cross-library support with pysheds.
I'm currently in the process of preparing pysheds for publication with a 1.0 release. This process has involved accelerating numerical code with numba along with some general refactoring. I'm happy to solicit any requests as I revisit the code.
In terms of integrating with xarray-spatial, I think a good first step would be to add support for a xarray datastructures and possibly replace my home-rolled Raster class. If you have any wishlist items, feel free to hop on over and post an issue.
I'd be interested in researching the potential to further accelerate or improve the scalability of these hydrologic processing tools (e.g. GPU processing, dask, etc.)
P.S. good to see you @chase-dwelle!