xarray-spatial icon indicating copy to clipboard operation
xarray-spatial copied to clipboard

Add Hydrology Tools

Open brendancol opened this issue 5 years ago • 9 comments

  • [ ] 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

brendancol avatar Mar 05 '20 02:03 brendancol

Below is a paper which outlines the process

hydro.pdf

brendancol avatar Mar 05 '20 02:03 brendancol

Also see https://github.com/pangeo-data/pangeo/issues/707 for interested parties who could test and evaluate this functionality.

jbednar avatar Mar 05 '20 13:03 jbednar

@thuydotm let's add these to a new module called xrspatial/hydro.py

brendancol avatar Jul 14 '20 18:07 brendancol

@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 avatar Oct 20 '20 01:10 chase-dwelle

@chase-dwelle that would be great. These have been sitting for a bit and would love for somebody and can help with testing

brendancol avatar Oct 20 '20 13:10 brendancol

@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

chase-dwelle avatar Oct 22 '20 12:10 chase-dwelle

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 avatar Nov 26 '20 14:11 benbovy

@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

brendancol avatar Nov 27 '20 14:11 brendancol

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!

mdbartos avatar Jan 13 '22 18:01 mdbartos