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

« back to all changes in this revision

Viewing changes to temporal/t.register/test.t.register.raster.file.timezone.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
# This is a test to register and unregister raster maps in
 
3
# space time raster input.
 
4
# The raster maps will be registered in different space time raster
 
5
# inputs
 
6
# Maps have absolute time with time zone information
 
7
 
 
8
# We need to set a specific region in the
 
9
# @preprocess step of this test. We generate
 
10
# raster with r.mapcalc and create two space time raster inputs
 
11
# with absolute time
 
12
# The region setting should work for UTM and LL test locations
 
13
g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
 
14
 
 
15
# Generate data
 
16
r.mapcalc --o expr="prec_1 = rand(0, 550)" -s
 
17
r.mapcalc --o expr="prec_2 = rand(0, 450)" -s
 
18
r.mapcalc --o expr="prec_3 = rand(0, 320)" -s
 
19
r.mapcalc --o expr="prec_4 = rand(0, 510)" -s
 
20
r.mapcalc --o expr="prec_5 = rand(0, 300)" -s
 
21
r.mapcalc --o expr="prec_6 = rand(0, 650)" -s
 
22
 
 
23
n2=`g.tempfile pid=2 -d` # Map names and start time
 
24
n3=`g.tempfile pid=3 -d` # Map names start time and increment
 
25
 
 
26
cat > "${n2}" << EOF
 
27
prec_1|2001-01-01 10:00:00 +02:00
 
28
prec_2|2001-02-01 10:00:00 +02:00
 
29
prec_3|2001-03-01 10:00:00 +02:00
 
30
prec_4|2001-04-01 10:00:00 +02:00
 
31
prec_5|2001-05-01 10:00:00 +02:00
 
32
prec_6|2001-06-01 10:00:00 +02:00
 
33
EOF
 
34
cat "${n2}"
 
35
 
 
36
cat > "${n3}" << EOF
 
37
prec_1|2001-01-01 12:00:00 +01:00|2001-04-01 14:00:00 -01:00
 
38
prec_2|2001-04-01 12:00:00 +01:00|2001-07-01 14:00:00 -01:00
 
39
prec_3|2001-07-01 12:00:00 +01:00|2001-10-01 14:00:00 -01:00
 
40
prec_4|2001-10-01 12:00:00 +01:00|2002-01-01 14:00:00 -01:00
 
41
prec_5|2002-01-01 12:00:00 +01:00|2002-04-01 14:00:00 -01:00
 
42
prec_6|2002-04-01 12:00:00 +01:00|2002-07-01 14:00:00 -01:00
 
43
EOF
 
44
cat "${n3}"
 
45
 
 
46
# The first @test
 
47
# We create the space time raster inputs and register the raster maps with absolute time interval
 
48
t.create --o type=strds temporaltype=absolute output=precip_abs title="A test with input files" descr="A test with input files"
 
49
 
 
50
# Test with input files
 
51
# File 1
 
52
# File 2
 
53
t.register --o input=precip_abs file="${n2}"
 
54
t.info type=strds input=precip_abs
 
55
t.rast.list input=precip_abs
 
56
# File 3
 
57
t.register --o -i input=precip_abs file="${n3}"
 
58
t.info type=strds input=precip_abs
 
59
t.rast.list input=precip_abs
 
60
 
 
61
t.remove -rf type=strds input=precip_abs