[GRASS-user] faster watershed routing

Hi GRASS list,

I have a watershed raster with 200 million cells. I calculate the basins and the baseline accumulation (i.e. flow=1) and have done so with r.watershed like this:

r.watershed -a elevation=e drainage=d accumulation=a basins=b threshold=50000 --q

That takes ~2 minutes.

I now need to calculate surface flow ~1000 times over this same watershed (every day for 3 years). That would take 1.5 days which is not unreasonable. But is there a faster way? Can I use the pre-computed basins and accumulation rasters? Is it faster to loop over the basins (there are ~1000 of them)? Or do I just run the entire command as above 1000 times but with variables for flow= and accumulation=?

Thanks,

  -k.

It seems the easiest way to speed this up is to parallelize it, which can be done fairly easily with GNU parallel.
https://grasswiki.osgeo.org/wiki/Parallelizing_Scripts#GNU_Parallel

ยทยทยท

On Sat, Feb 11, 2017 at 8:12 AM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi GRASS list,

I have a watershed raster with 200 million cells. I calculate the basins and the baseline accumulation (i.e. flow=1) and have done so with r.watershed like this:

r.watershed -a elevation=e drainage=d accumulation=a basins=b threshold=50000 --q

That takes ~2 minutes.

I now need to calculate surface flow ~1000 times over this same watershed (every day for 3 years). That would take 1.5 days which is not unreasonable. But is there a faster way? Can I use the pre-computed basins and accumulation rasters? Is it faster to loop over the basins (there are ~1000 of them)? Or do I just run the entire command as above 1000 times but with variables for flow= and accumulation=?

Thanks,

-k.