[GRASS-user] Aggregating daily maps in relative strds per month

Veronica Andreo veroandreo at gmail.com
Sun May 17 13:07:30 PDT 2015


Hi Nikos!

If the data in fact represent daily data, why don't you register it as
absolute time?? In that way, you would just loop over strds...

for STRDS in global_rad_zero beam_rad_zero diff_rad_zero insol_time
do
t.rast.aggregate input=${STRDS} output=${STRDS}_monthly_average
basename=${STRDS}_average granularity="1 month" method=average
done

Cheers,
Vero
Is there a better way to aggregate a *relative* spatio-temporal raster
data set composed by daily maps (output from r.sun.daily) in monthly
average strds-es?

At the moment I use the following csv and script:

--%<---
# month_start_end_day.csv
January|1|31
February|32|59
March|60|90
April|91|120
May|121|151
June|152|181
July|182|212
August|213|243
September|244|273
October|274|304
November|305|334
December|335|365
--->%--

and

--%<---
# loop over spatio-temporal raster data sets of interest
for STRDS in global_rad_zero beam_rad_zero diff_rad_zero insol_time
do
    # loop over months (start day, end day, month name) in csv
    for LINE in `cat month_start_end_day.csv`

    do
        # set positional parameters
        set -- $(echo ${LINE} |tr "|" " ")

        # aggregate
        t.rast.aggregate input=${STRDS} output=${STRDS}_$1_average
basename=${STRDS}_$1_average where="start_time >= $2 AND start_time <= $3"
granularity=1 --o
    done

done
--->%--

Any tip highly appreciated, Nikos
_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150517/d63ac981/attachment.html>


More information about the grass-user mailing list