[GRASS-user] t.rast.algebra with strds of different granularity

Sören Gebbert soerengebbert at googlemail.com
Thu Mar 2 13:09:27 PST 2017


Hi,

2017-03-02 13:35 GMT+01:00 Veronica Andreo <veroandreo at gmail.com>:
> Hi list,
>
> Just by mistake, I did an operation between two time series (strds) with
> t.rast.algebra, and only after a while I realized that they have different
> granularity (while I thought they had the same). One of them is daily (from
> 00:00:00 to 00:00:00, 24 hs intervals) and the other is also daily, but
> intervals are from 10:30 to 22:30 (12 hours). Anyway, the second one is
> temporally included/contained in the first one. However, when I make a
> substraction among them, I get an empty strds as result and no error nor
> warning message.

The default temporal-topological operator is "equal". The expression:

C = A - B

is the short form of:

C = A {-, equal, l} B

Since your timestamps are not equal, the result is an empty STRDS.
>From my standpoint this is the correct result of this expression, no
need to raise an error or a warning. r.mapcalc for example will not
warn you, if the result of your expression is an empty raster map.

Using the correct temporal-topological operator is the key in your
case. Your suggestion below is correct. You need to specify the
"contains" relationship to compute the desired results.

The following expression:

C = A {-, contains} B

means, compute the difference between all maps from A and B that
fulfill the "contains" temporal relationship. The temporal topological
operation will be evaluated between all maps from A and B. If a map
from A has a contains relationship to one or several maps of B, then
the difference between the two/many maps will be computed and the
timestamp of the left side of the statement (timestamps from A) will
be used for the resulting maps. You can specify if the left or right
timestamps should be used for the result maps or the intersection or
union of the involved map timestamps. Be aware that implicit
aggregation will be performed if more than one map is found to compute
the difference.

Best regards
Soeren

>
> This is how I wrote the command:
>
> t.rast.algebra -n basename=lwr_minus_orig expression="abs_lwr_minus_orig =
> abs(LST_Day_2016_lwr1 - LST_Day_2016_orig)"
>
> How should it look like for the temporal topology to be considered, then?
> Something like:
>
> expression="abs_lwr_minus_orig = abs(LST_Day_2016_lwr1 { -, contains }
> LST_Day_2016_orig)"  ??
>
> Shouldn't a warning be raised when granularities are different and no
> temporal topology operator is used? Dunno if that's possible at all.
>
> Thanks for any tips
>
> Vero
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list