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

Sören Gebbert soerengebbert at googlemail.com
Mon May 18 04:08:08 PDT 2015


Hi Nikos,
sorry for the late response.

The aggregation of daily relative time STRDS with Gregorian monthly
granularity is not possible, since in relative time mode, there is no
connection between daily and monthly calendar hierarchy. The reason is
that in relative time mode there is no starting point in calendar time
at which day 1,2 or n starts. Hence you never know to which month or
year a day is associated, because of the lack of a calendar hierarchy.
The number of days per month and per year are different in the
Gregorian calendar, hence the output of r.sun.daily should be in my
humble opinion yearly and monthly specific.

However, you can create a second STDS with relative time, that
contains of 12 maps with the according time intervals (31 days, 28/29
days, ...) and use t.rast.aggregate.ds to aggregate the first STRDS
based on the time intervals of the second STDS.

Best regards
Soeren

2015-05-16 13:41 GMT+02:00 Nikos Alexandris <nik at nikosalexandris.net>:
> 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


More information about the grass-user mailing list