Implement additional functions into the `pysheds` terrain engine
pysheds
is faster than TauDEM and has the advantage of operating 100% in memory, which avoids temporary files and could be better scaled up if fcpgtools
was ever to operate as an API endpoint process.
That said, as of now it only supports fcpgtools.accumulate_flow()
and fcpgtools.accumulate_parameter()
. Meanwhile the TauDEM engine supports additional functions which as listed below may be able to be implemented in PySheds with additional effort/funding.
-
fcpgtools.distance_to_stream()
- one option would be to usepysheds.Grid().distance_to_outlet()
N times where N is the number of stream cells, then applying axarray.ufunc()
to get the minimum value across N dimensions and reduce back down to one dimension. This would likely be poor performance. The more performant option is to contribute topysheds
building off the existingpysheds.Grid().distance_to_ridge()
logic except make it move downstream instead of upstream and take stream cells as an argument. -
fcpgtools.decay_accumulation()
- this would not be particularly hard! We could use theefficiency
parameter orpysheds.Grid().accumulation()
to act as the decay multiplier grid. -
fcpgtools.extreme_upslope_values()
- would involve contributing to thepysheds
project and building off their existing flow accumulation algo to just keep track of the max/min value when iterating (or recursing) up the network.