[GRASS-user] 10day accumulation which t.rast module to use?

Veronica Andreo veroandreo at gmail.com
Wed Dec 3 12:31:16 PST 2014


Hi Emmanuel,

> Hi,
>
> I have 3hourly rainrate data for a given region in a GRASS temporal
> database (strds).
>
> I want to aggregate the data by summing all raster from the previous
> 10 days to calculate the accumulated rainfall.
> The temporal modules have several tools:
> t.rast.series
> t.rast.accumulate
> t.rast.aggregate
> t.rast.mapcalc
>
> >From the manual, the appropriate module seems to be t.rast.accumulate
> but it does not have sum in the method parameters. Currently, I'm
> running several r.series commands for each day like below:
>
> r.series input=\
> "`t.rast.list input=3hr_rainrate where=\
> "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \
> and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \
> col=name method=comma`" \
> output="test_2014-07-20" method=sum
>
> Then, register each layer in another strds:
>
> #Create a new STRDS
> t.create output='10day_accumulation' type='strds' temporaltype='absolute'
\
>             title='10day_accumulation' \
>             description="10 day rainfall accumulation"
>
>
> g.mlist type='rast', pattern='test*', separator=','
>
> #Register the r.series output to the strds
> t.register -i type=rast input=10day_accumulation \
>         start="2014-07-10 00:00:00" increment="1 days" separator="," \
>         maps="`g.mlist type='rast', pattern='test*', separator=','`"
>
>
> Is there another approach using directly any of the t.rast.* modules.
> For a time-line visualization, here's what I want to do:
> https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png
>
> Thanks!

If i understood right, something like

t.rast.aggregate input=3hr_rainrate output=10day_rain basename=10day_rain
granularity='10 days' method=sum

should do the what you need.

HTH,

Vero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20141203/fc3eb9aa/attachment.html>


More information about the grass-user mailing list