~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to temporal/t.support/test.t.support.sh

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Tests the support module of space time datasets 
 
3
 
 
4
# We need to set a specific region in the
 
5
# @preprocess step of this test. 
 
6
# The region setting should work for UTM and LL test locations
 
7
g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
 
8
 
 
9
# Generate data
 
10
r.mapcalc --o expr="prec_1 = rand(0, 550)" -s
 
11
r.mapcalc --o expr="prec_2 = rand(0, 450)" -s
 
12
r.mapcalc --o expr="prec_3 = rand(0, 320)" -s
 
13
r.mapcalc --o expr="prec_4 = rand(0, 510)" -s
 
14
r.mapcalc --o expr="prec_5 = rand(0, 300)" -s
 
15
r.mapcalc --o expr="prec_6 = rand(0, 650)" -s
 
16
# We create several space time raster datasets
 
17
 
 
18
# @test Register the maps in two space time datasets
 
19
t.create --v --o type=strds temporaltype=absolute output=precip_abs1 title="Test" descr="This is the 1 test strds" semantictype=sum
 
20
t.register -i --o input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 seconds"
 
21
 
 
22
t.create --v --o type=strds temporaltype=absolute output=precip_abs2 title="Test" descr="This is the 2 test strds" semantictype=sum
 
23
t.register -i --o input=precip_abs2 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
 
24
 
 
25
t.create --v --o type=strds temporaltype=relative output=precip_rel1 title="Test" descr="This is the 1 test strds" semantictype=min
 
26
 
 
27
# Check metadata update
 
28
t.info type=strds input=precip_rel1
 
29
t.support --v type=strds input=precip_rel1 title="Test support" descr="This is the support test strds" semantictype=max
 
30
t.info type=strds input=precip_rel1
 
31
 
 
32
 
 
33
# Check metadata update
 
34
t.info type=strds input=precip_abs1
 
35
t.support --v type=strds input=precip_abs1 title="Test support" descr="This is the support test strds" semantictype=mean
 
36
t.info type=strds input=precip_abs1
 
37
 
 
38
 
 
39
# @test the map update function
 
40
g.region s=0 n=80 w=0 e=120 b=0 t=50 res=20 res3=20
 
41
 
 
42
# Generate data
 
43
r.mapcalc --o expr="prec_1 = rand(0, 55)" -s
 
44
r.mapcalc --o expr="prec_2 = rand(0, 45)" -s
 
45
r.mapcalc --o expr="prec_3 = rand(0, 32)" -s
 
46
r.mapcalc --o expr="prec_4 = rand(0, 51)" -s
 
47
r.mapcalc --o expr="prec_5 = rand(0, 30)" -s
 
48
r.mapcalc --o expr="prec_6 = rand(0, 65)" -s
 
49
 
 
50
# The map dependent metadata should have been updated
 
51
t.support --v -m type=strds input=precip_abs1
 
52
t.info type=strds input=precip_abs1
 
53
t.support --v -m type=strds input=precip_abs2
 
54
t.info type=strds input=precip_abs2
 
55
 
 
56
# Remove three maps
 
57
g.remove -f type=raster name=prec_1,prec_2,prec_3
 
58
 
 
59
# Booth space time datasets should be updated and 3 maps must have been unregistered
 
60
t.support --v -m type=strds input=precip_abs1
 
61
t.info type=strds input=precip_abs1
 
62
t.info type=strds input=precip_abs2
 
63
 
 
64
t.remove --v type=strds input=precip_abs1,precip_rel1
 
65
t.unregister type=raster maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
 
66
g.remove -f type=raster name=prec_4,prec_5,prec_6