| 1 |
#!/bin/sh |
| 2 |
# Simple r.series wrapper |
| 3 |
# We need to set a specific region in the |
| 4 |
# @preprocess step of this test. |
| 5 |
# The region setting should work for UTM and LL test locations |
| 6 |
g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3 |
| 7 |
|
| 8 |
r.mapcalc --o expr="prec_1 = 100" |
| 9 |
r.mapcalc --o expr="prec_2 = 200" |
| 10 |
r.mapcalc --o expr="prec_3 = 300" |
| 11 |
r.mapcalc --o expr="prec_4 = 400" |
| 12 |
r.mapcalc --o expr="prec_5 = 500" |
| 13 |
r.mapcalc --o expr="prec_6 = 600" |
| 14 |
|
| 15 |
# @test |
| 16 |
t.create --o type=strds temporaltype=absolute output=precip_abs title="A test" descr="A test" |
| 17 |
|
| 18 |
t.register type=raster input=precip_abs maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 months" |
| 19 |
t.rast.list precip_abs |
| 20 |
|
| 21 |
t.rast.series --o -t input=precip_abs method=average,range output=prec_average,prec_range where="start_time > '2001-03-01'" |
| 22 |
t.rast.series --o -t input=precip_abs method=average output=prec_average where="start_time > '2001-03-01'" |
| 23 |
t.rast.series --o input=precip_abs method=maximum output=prec_max order=start_time |
| 24 |
t.rast.series input=precip_abs method=sum output=prec_sum |
| 25 |
t.rast.series --o input=precip_abs method=sum output=prec_sum |
| 26 |
# This test should raise an error |
| 27 |
t.rast.series input=precip_abs method=sum output=prec_sum |
| 28 |
|
| 29 |
r.info prec_average |
| 30 |
r.info prec_max |
| 31 |
r.info prec_sum |
| 32 |
|
| 33 |
t.unregister type=raster maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6,prec_sum,prec_max |
| 34 |
t.remove type=strds input=precip_abs |
| 35 |
|
| 36 |
g.remove -f type=raster name=prec_sum,prec_max,prec_average,prec_range |