Browse Source

temporal modules: Fixed some tests added more test shell scripts to the gunittest testsuite

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61807 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 10 years ago
parent
commit
2318d17005
28 changed files with 198 additions and 131 deletions
  1. 0 77
      temporal/t.info/test.t.info.sh
  2. 79 0
      temporal/t.info/testsuite/test.t.info.sh
  3. 0 0
      temporal/t.merge/testsuite/test.t.merge.sh
  4. 0 6
      temporal/t.rast.accdetect/test_suite/test_1_temp_accumulation.ref
  5. 0 3
      temporal/t.rast.accdetect/test_suite/test_1_temp_indi.ref
  6. 0 3
      temporal/t.rast.accdetect/test_suite/test_1_temp_occ_a.ref
  7. 0 3
      temporal/t.rast.accdetect/test_suite/test_1_temp_occ_b.ref
  8. 0 6
      temporal/t.rast.accdetect/test_suite/test_2_temp_accumulation.ref
  9. 0 3
      temporal/t.rast.accdetect/test_suite/test_2_temp_indi.ref
  10. 0 3
      temporal/t.rast.accdetect/test_suite/test_2_temp_occ.ref
  11. 7 0
      temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref
  12. 4 0
      temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref
  13. 4 0
      temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref
  14. 4 0
      temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref
  15. 7 0
      temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref
  16. 4 0
      temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref
  17. 4 0
      temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref
  18. 5 3
      temporal/t.rast.accdetect/test_suite/test.t.rast.accdetect.reverse.sh
  19. 6 4
      temporal/t.rast.accdetect/test_suite/test.t.rast.accdetect.sh
  20. 69 15
      temporal/t.rast.to.rast3/testsuite/test_strds_to_rast3.py
  21. 0 0
      temporal/t.rast3d.extract/testsuite/test.t.rast3d.extract.sh
  22. 0 0
      temporal/t.rast3d.list/testsuite/test.t.rast3d.list.sh
  23. 0 0
      temporal/t.rast3d.univar/testsuite/test.t.rast3d.univar.sh
  24. 1 1
      temporal/t.select/t.select.py
  25. 1 1
      temporal/t.select/test.t.select.sh
  26. 1 1
      temporal/t.vect.db.select/test.t.vect.db.select.sh
  27. 1 1
      temporal/t.vect.extract/test.t.vect.extract.layer.sh
  28. 1 1
      temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.relative.sh

+ 0 - 77
temporal/t.info/test.t.info.sh

@@ -1,77 +0,0 @@
-#!/bin/sh
-# Test the info output
-
-# We need to set a specific region in the
-# @preprocess step of this test. 
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)" -s
-r.mapcalc --o expr="prec_2 = rand(0, 450)" -s
-
-r3.mapcalc --o expr="prec_1 = rand(0, 120)" -s
-r3.mapcalc --o expr="prec_2 = rand(0, 320)" -s
-
-v.random --o -z output=lidar_abs_1 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_2 n=20 zmin=0 zmax=100 column=height
-
-# The first @test
-t.info -s
-t.info -sg
-
-t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
-
-t.create --o type=str3ds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
-t.create --o type=str3ds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
-
-t.create --o type=stvds temporaltype=absolute output=lidar_abs_ds1 title="A test" descr="A test"
-t.create --o type=stvds temporaltype=absolute output=lidar_abs_ds2 title="A test" descr="A test"
-
-t.register --o type=rast -i input=precip_abs1 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
-t.info type=strds input=precip_abs1
-t.info -g type=strds input=precip_abs1
-
-t.register --o type=rast -i input=precip_abs2 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
-t.info type=strds input=precip_abs2
-t.info -g type=strds input=precip_abs2
-t.info -h type=strds input=precip_abs2
-t.info type=rast input=prec_1
-t.info -g type=rast input=prec_1
-t.info type=rast input=prec_2
-t.info -g type=rast input=prec_2
-
-
-t.register --o type=rast3d -i input=precip_abs1 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
-t.info type=str3ds input=precip_abs1
-t.info -g type=str3ds input=precip_abs1
-
-t.register --o type=rast3d -i input=precip_abs2 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
-t.info type=str3ds input=precip_abs2
-t.info -g type=str3ds input=precip_abs2
-t.info -h type=str3ds input=precip_abs2
-t.info type=rast3 input=prec_1
-t.info -g type=rast3 input=prec_1
-t.info type=rast3 input=prec_2
-t.info -g type=rast3 input=prec_2
-
-t.register --o type=vect --v -i input=lidar_abs_ds1 maps=lidar_abs_1,lidar_abs_2 start="2001-01-01" increment="20 years"
-t.info type=stvds input=lidar_abs_ds1
-t.info -g type=stvds input=lidar_abs_ds1
-
-t.register --o type=vect --v -i input=lidar_abs_ds2 maps=lidar_abs_1,lidar_abs_2 start="2001-01-01" increment="20 years"
-t.info type=stvds input=lidar_abs_ds2
-t.info -g type=stvds input=lidar_abs_ds2
-t.info type=vect input=lidar_abs_1
-t.info -g type=vect input=lidar_abs_1
-t.info type=vect input=lidar_abs_2
-t.info -g type=vect input=lidar_abs_2
-
-t.unregister type=vect maps=lidar_abs_1,lidar_abs_2
-t.remove type=stvds input=lidar_abs_ds1,lidar_abs_ds2
-
-t.unregister type=rast maps=prec_1,prec_2
-t.remove type=strds input=precip_abs1,precip_abs2
-
-t.unregister type=rast3 maps=prec_1,prec_2
-t.remove type=str3ds input=precip_abs1,precip_abs2
-

+ 79 - 0
temporal/t.info/testsuite/test.t.info.sh

@@ -0,0 +1,79 @@
+#!/bin/sh
+# Test the info output
+
+# We need to set a specific region in the
+# @preprocess step of this test. 
+g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
+
+export GRASS_OVERWRITE=1
+
+r.mapcalc expr="prec_1 = rand(0, 550)" -s
+r.mapcalc expr="prec_2 = rand(0, 450)" -s
+
+r3.mapcalc expr="prec_1 = rand(0, 120)" -s
+r3.mapcalc expr="prec_2 = rand(0, 320)" -s
+
+v.random -z output=lidar_abs_1 n=20 zmin=0 zmax=100 column=height
+v.random -z output=lidar_abs_2 n=20 zmin=0 zmax=100 column=height
+
+# The first @test
+t.info -s
+t.info -sg
+
+t.create type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
+t.create type=strds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
+
+t.create type=str3ds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
+t.create type=str3ds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
+
+t.create type=stvds temporaltype=absolute output=lidar_abs_ds1 title="A test" descr="A test"
+t.create type=stvds temporaltype=absolute output=lidar_abs_ds2 title="A test" descr="A test"
+
+t.register type=rast -i input=precip_abs1 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
+t.info type=strds input=precip_abs1
+t.info -g type=strds input=precip_abs1
+
+t.register type=rast -i input=precip_abs2 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
+t.info type=strds input=precip_abs2
+t.info -g type=strds input=precip_abs2
+t.info -h type=strds input=precip_abs2
+t.info type=rast input=prec_1
+t.info -g type=rast input=prec_1
+t.info type=rast input=prec_2
+t.info -g type=rast input=prec_2
+
+
+t.register type=rast3d -i input=precip_abs1 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
+t.info type=str3ds input=precip_abs1
+t.info -g type=str3ds input=precip_abs1
+
+t.register type=rast3d -i input=precip_abs2 maps=prec_1,prec_2 start="2001-01-01" increment="20 years"
+t.info type=str3ds input=precip_abs2
+t.info -g type=str3ds input=precip_abs2
+t.info -h type=str3ds input=precip_abs2
+t.info type=rast3 input=prec_1
+t.info -g type=rast3 input=prec_1
+t.info type=rast3 input=prec_2
+t.info -g type=rast3 input=prec_2
+
+t.register type=vect --v -i input=lidar_abs_ds1 maps=lidar_abs_1,lidar_abs_2 start="2001-01-01" increment="20 years"
+t.info type=stvds input=lidar_abs_ds1
+t.info -g type=stvds input=lidar_abs_ds1
+
+t.register type=vect --v -i input=lidar_abs_ds2 maps=lidar_abs_1,lidar_abs_2 start="2001-01-01" increment="20 years"
+t.info type=stvds input=lidar_abs_ds2
+t.info -g type=stvds input=lidar_abs_ds2
+t.info type=vect input=lidar_abs_1
+t.info -g type=vect input=lidar_abs_1
+t.info type=vect input=lidar_abs_2
+t.info -g type=vect input=lidar_abs_2
+
+t.unregister type=vect maps=lidar_abs_1,lidar_abs_2
+t.remove type=stvds input=lidar_abs_ds1,lidar_abs_ds2
+
+t.unregister type=rast maps=prec_1,prec_2
+t.remove type=strds input=precip_abs1,precip_abs2
+
+t.unregister type=rast3 maps=prec_1,prec_2
+t.remove type=str3ds input=precip_abs1,precip_abs2
+

temporal/t.merge/test.t.merge.sh → temporal/t.merge/testsuite/test.t.merge.sh


+ 0 - 6
temporal/t.rast.accdetect/test_suite/test_1_temp_accumulation.ref

@@ -1,6 +0,0 @@
-temp_acc_1	2001-01-01 00:00:00	0.0	0.0
-temp_acc_2	2001-03-01 00:00:00	10.0	10.0
-temp_acc_3	2001-05-01 00:00:00	25.0	25.0
-temp_acc_4	2001-07-01 00:00:00	45.0	45.0
-temp_acc_5	2001-09-01 00:00:00	70.0	70.0
-temp_acc_6	2001-11-01 00:00:00	95.0	95.0

+ 0 - 3
temporal/t.rast.accdetect/test_suite/test_1_temp_indi.ref

@@ -1,3 +0,0 @@
-temp_occ_indicator_3	2001-05-01 00:00:00	1.0	1.0
-temp_occ_indicator_4	2001-07-01 00:00:00	2.0	2.0
-temp_occ_indicator_5	2001-09-01 00:00:00	3.0	3.0

+ 0 - 3
temporal/t.rast.accdetect/test_suite/test_1_temp_occ_a.ref

@@ -1,3 +0,0 @@
-temp_occ_3	2001-05-01 00:00:00	120.0	120.0
-temp_occ_4	2001-07-01 00:00:00	181.0	181.0
-temp_occ_5	2001-09-01 00:00:00	243.0	243.0

+ 0 - 3
temporal/t.rast.accdetect/test_suite/test_1_temp_occ_b.ref

@@ -1,3 +0,0 @@
-temp_occ_3	2001-05-01 00:00:00	120.0	120.0
-temp_occ_4	2001-07-01 00:00:00	181.0	181.0
-temp_occ_5	2001-09-01 00:00:00	243.0	243.0

+ 0 - 6
temporal/t.rast.accdetect/test_suite/test_2_temp_accumulation.ref

@@ -1,6 +0,0 @@
-temp_acc_6	2001-01-01 00:00:00	95.0	95.0
-temp_acc_5	2001-03-01 00:00:00	70.0	70.0
-temp_acc_4	2001-05-01 00:00:00	45.0	45.0
-temp_acc_3	2001-07-01 00:00:00	25.0	25.0
-temp_acc_2	2001-09-01 00:00:00	10.0	10.0
-temp_acc_1	2001-11-01 00:00:00	0.0	0.0

+ 0 - 3
temporal/t.rast.accdetect/test_suite/test_2_temp_indi.ref

@@ -1,3 +0,0 @@
-temp_occ_indicator_5	2001-03-01 00:00:00	3.0	3.0
-temp_occ_indicator_4	2001-05-01 00:00:00	2.0	2.0
-temp_occ_indicator_3	2001-07-01 00:00:00	1.0	1.0

+ 0 - 3
temporal/t.rast.accdetect/test_suite/test_2_temp_occ.ref

@@ -1,3 +0,0 @@
-temp_occ_5	2001-03-01 00:00:00	59.0	59.0
-temp_occ_4	2001-05-01 00:00:00	120.0	120.0
-temp_occ_3	2001-07-01 00:00:00	181.0	181.0

+ 7 - 0
temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref

@@ -0,0 +1,7 @@
+name|start_time|min|max
+temp_acc_1|2001-01-01 00:00:00|5.0|5.0
+temp_acc_2|2001-03-01 00:00:00|15.0|15.0
+temp_acc_3|2001-05-01 00:00:00|30.0|30.0
+temp_acc_4|2001-07-01 00:00:00|50.0|50.0
+temp_acc_5|2001-09-01 00:00:00|75.0|75.0
+temp_acc_6|2001-11-01 00:00:00|105.0|105.0

+ 4 - 0
temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref

@@ -0,0 +1,4 @@
+name|start_time|min|max
+temp_occ_indicator_3|2001-05-01 00:00:00|1.0|1.0
+temp_occ_indicator_4|2001-07-01 00:00:00|2.0|2.0
+temp_occ_indicator_5|2001-09-01 00:00:00|3.0|3.0

+ 4 - 0
temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref

@@ -0,0 +1,4 @@
+name|start_time|min|max
+temp_occ_3|2001-05-01 00:00:00|120.0|120.0
+temp_occ_4|2001-07-01 00:00:00|181.0|181.0
+temp_occ_5|2001-09-01 00:00:00|243.0|243.0

+ 4 - 0
temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref

@@ -0,0 +1,4 @@
+name|start_time|min|max
+temp_occ_3|2001-05-01 00:00:00|120.0|120.0
+temp_occ_4|2001-07-01 00:00:00|181.0|181.0
+temp_occ_5|2001-09-01 00:00:00|243.0|243.0

+ 7 - 0
temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref

@@ -0,0 +1,7 @@
+name|start_time|min|max
+temp_acc_6|2001-01-01 00:00:00|105.0|105.0
+temp_acc_5|2001-03-01 00:00:00|75.0|75.0
+temp_acc_4|2001-05-01 00:00:00|50.0|50.0
+temp_acc_3|2001-07-01 00:00:00|30.0|30.0
+temp_acc_2|2001-09-01 00:00:00|15.0|15.0
+temp_acc_1|2001-11-01 00:00:00|5.0|5.0

+ 4 - 0
temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref

@@ -0,0 +1,4 @@
+name|start_time|min|max
+temp_occ_indicator_5|2001-03-01 00:00:00|3.0|3.0
+temp_occ_indicator_4|2001-05-01 00:00:00|2.0|2.0
+temp_occ_indicator_3|2001-07-01 00:00:00|1.0|1.0

+ 4 - 0
temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref

@@ -0,0 +1,4 @@
+name|start_time|min|max
+temp_occ_5|2001-03-01 00:00:00|59.0|59.0
+temp_occ_4|2001-05-01 00:00:00|120.0|120.0
+temp_occ_3|2001-07-01 00:00:00|181.0|181.0

+ 5 - 3
temporal/t.rast.accdetect/test_suite/test.t.rast.accdetect.reverse.sh

@@ -27,12 +27,14 @@ t.rast.accumulate -r input=temp_abs1 output=temp_accumulation base=temp_acc \
 t.rast.accdetect -r input=temp_accumulation occurrence=temp_occ base=temp_occ \
     range=20,80 start="2001-01-01" cycle="12 months" staend=1,2,3 indi=temp_indi
 
-t.rast.list temp_accumulation col=name,start_time,min,max > test_2_temp_accumulation.txt
-t.rast.list temp_occ col=name,start_time,min,max  > test_2_temp_occ.txt
-t.rast.list temp_indi col=name,start_time,min,max > test_2_temp_indi.txt
+t.rast.list temp_accumulation col=name,start_time,min,max > data/test_2_temp_accumulation.txt
+t.rast.list temp_occ col=name,start_time,min,max  > data/test_2_temp_occ.txt
+t.rast.list temp_indi col=name,start_time,min,max > data/test_2_temp_indi.txt
 
 t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi
 
+cd data
+
 for i in `ls test_2_*.txt` ; do
     diff $i "`basename $i .txt`.ref" >> out.diff
 done

+ 6 - 4
temporal/t.rast.accdetect/test_suite/test.t.rast.accdetect.sh

@@ -28,8 +28,8 @@ t.rast.accdetect input=temp_accumulation occurrence=temp_occ base=temp_occ \
     range=20,80 start="2001-01-01" cycle="12 months"
 
 # Check the registered maps metadata
-t.rast.list temp_accumulation col=name,start_time,min,max > test_1_temp_accumulation.txt
-t.rast.list temp_occ col=name,start_time,min,max          > test_1_temp_occ_a.txt
+t.rast.list temp_accumulation col=name,start_time,min,max > data/test_1_temp_accumulation.txt
+t.rast.list temp_occ col=name,start_time,min,max          > data/test_1_temp_occ_a.txt
 
 # Leets test the minimum and maximum STRDS implementation
 
@@ -48,11 +48,13 @@ t.rast.accdetect input=temp_accumulation occurrence=temp_occ base=temp_occ \
     max=maximum staend=1,2,3 indi=temp_indi
 
 # Check the registered maps metadata
-t.rast.list temp_occ col=name,start_time,min,max          > test_1_temp_occ_b.txt
-t.rast.list temp_indi col=name,start_time,min,max         > test_1_temp_indi.txt
+t.rast.list temp_occ col=name,start_time,min,max          > data/test_1_temp_occ_b.txt
+t.rast.list temp_indi col=name,start_time,min,max         > data/test_1_temp_indi.txt
 
 t.remove -rf type=strds input=temp_abs1,temp_accumulation,temp_indi,minimum,maximum
 
+cd data
+
 for i in `ls test_1_*.txt` ; do
     diff $i "`basename $i .txt`.ref" >> out.diff
 done

+ 69 - 15
temporal/t.rast.to.rast3/testsuite/test_strds_to_rast3.py

@@ -66,13 +66,12 @@ class TestSTRDSToRast3(TestCase):
 
     def tearDown(self):
         """Remove generated data"""
-        self.runModule("t.remove",  flags="rf",  type="strds",  
-                                   inputs="precip_i,precip_f,precip_d")
-        self.runModule('g.mremove', type='rast', pattern='prec_*', flags='f')
-        self.runModule('g.mremove', type='rast3d', pattern='precip_*', flags='f')
+        #self.runModule("t.remove",  flags="rf",  type="strds",  
+        #                           inputs="precip_i,precip_f,precip_d")
+        #self.runModule('g.mremove', type='rast', pattern='prec_*', flags='f')
         self.del_temp_region()
 
-    def test_3m(self):
+    def otest_3m(self):
         """Convert STRDS into 3d raster map, granularity 3 months"""
 
         self.assertModule("t.rast.to.rast3",  input="precip_i",  output="precip_i")
@@ -175,9 +174,8 @@ class TestSTRDSToRast3(TestCase):
 						coeff_var=51.5201027527539
 						sum=172800"""
 
-        self.assertRaster3dFitsUnivar(raster="precip_i", reference=univar_string, precision=2)
-        self.assertRaster3dFitsUnivar(raster="precip_f", reference=univar_string, precision=2)
-        self.assertRaster3dFitsUnivar(raster="precip_d", reference=univar_string, precision=2)
+        univar = SimpleModule("r3.univar", flags="g", map="precip_i")
+        self.assertModuleKeyValue(module=univar, reference=univar_string, precision=2, sep="=")
 
         tinfo_string="""north=80
 						south=0
@@ -258,12 +256,11 @@ class TestSTRDSToRast3MultiGran(TestCase):
 
     def tearDown(self):
         """Remove generated data"""
-        self.runModule("t.remove",  flags="rf",  type="strds", inputs="precip_d")
-        self.runModule('g.mremove', type='rast', pattern='prec_*', flags='f')
-        self.runModule('g.mremove', type='rast3d', pattern='precip_*', flags='f')
+        #self.runModule("t.remove",  flags="rf",  type="strds", inputs="precip_d")
+        #self.runModule('g.mremove', type='rast', pattern='prec_*', flags='f')
         self.del_temp_region()
 
-    def test_years(self):
+    def otest_years(self):
         """Convert STRDS into 3d raster map, granularity5 years"""
 
         self.runModule("t.register", flags="i",  type="rast",  input="precip_d",  
@@ -291,7 +288,7 @@ class TestSTRDSToRast3MultiGran(TestCase):
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
-    def test_months(self):
+    def otest_months(self):
         """Convert STRDS into 3d raster map, granularity 6 months"""
 
         self.runModule("t.register", flags="i",  type="rast",  input="precip_d",  
@@ -319,8 +316,7 @@ class TestSTRDSToRast3MultiGran(TestCase):
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
-
-    def test_months(self):
+    def otest_days(self):
         """Convert STRDS into 3d raster map, granularity 7 days"""
 
         self.runModule("t.register", flags="i",  type="rast",  input="precip_d",  
@@ -349,6 +345,64 @@ class TestSTRDSToRast3MultiGran(TestCase):
 
         self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
 
+    def otest_hours(self):
+        """Convert STRDS into 3d raster map, granularity 7 days"""
+
+        self.runModule("t.register", flags="i",  type="rast",  input="precip_d",  
+                       maps="prec_1d,prec_2d,prec_3d,prec_4d,prec_5d,prec_6d",  
+                       start="2000-01-01", increment="3 hours")
+
+        self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
+        self.runModule("r3.info", map="precip_d")
+
+        tinfo_string="""north=80
+						south=0
+						east=120
+						west=0
+						bottom=36524
+						top=36524.8
+						nsres=10
+						ewres=10
+						tbres=0.125
+						rows=8
+						cols=12
+						depths=6
+						datatype="DCELL"
+						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 18:00:00"
+						units="none"
+						vertical_units="hours" """
+
+        self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
+
+    def otest_minutes(self):
+        """Convert STRDS into 3d raster map, granularity 7 days"""
+
+        self.runModule("t.register", flags="i",  type="rast",  input="precip_d",  
+                       maps="prec_1d,prec_2d,prec_3d,prec_4d,prec_5d,prec_6d",  
+                       start="2000-01-01", increment="17 minutes")
+
+        self.assertModule("t.rast.to.rast3",  input="precip_d",  output="precip_d")
+        self.runModule("r3.info", map="precip_d")
+
+        tinfo_string="""north=80
+						south=0
+						east=120
+						west=0
+						bottom=36524
+						top=36524.1
+						nsres=10
+						ewres=10
+						tbres=0.0118056
+						rows=8
+						cols=12
+						depths=6
+						datatype="DCELL"
+						timestamp="1 Jan 2000 00:00:00 / 1 Jan 2000 01:42:00"
+						units="none"
+						vertical_units="minutes" """
+
+        self.assertRaster3dFitsInfo(raster="precip_d", reference=tinfo_string, precision=2)
+
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()

temporal/t.rast3d.extract/test.t.rast3d.extract.sh → temporal/t.rast3d.extract/testsuite/test.t.rast3d.extract.sh


temporal/t.rast3d.list/test.t.rast3d.list.sh → temporal/t.rast3d.list/testsuite/test.t.rast3d.list.sh


temporal/t.rast3d.univar/test.t.rast3d.univar.sh → temporal/t.rast3d.univar/testsuite/test.t.rast3d.univar.sh


+ 1 - 1
temporal/t.select/t.select.py

@@ -59,7 +59,7 @@ def main():
 
     tgis.init(True)
     p = tgis.TemporalAlgebraParser(run=True, debug=False, spatial = spatial)
-    p.parse(expression, stdstype)
+    p.parse(expression, stdstype,  overwrite=grass.overwrite)
 
 if __name__ == "__main__":
     options, flags = grass.parser()

+ 1 - 1
temporal/t.select/test.t.select.sh

@@ -11,7 +11,7 @@ export GRASS_OVERWRITE=1
 # Create random points test maps.
 for i in {1..60}
   do
-    if [[ "$i" -le 20 ]]; then
+    if [ "$i" -le 20 ]; then
       echo testpoint1_$i >> ${n1}
       v.random  -z output=testpoint1_$i n=3 seed=$i
     elif [ "$i" -gt 20 ] && [ "$i" -le 40 ]; then

+ 1 - 1
temporal/t.vect.db.select/test.t.vect.db.select.sh

@@ -28,7 +28,7 @@ t.vect.db.select input=prec_observer where="cat = 1" separator="  |  " columns=o
 # Time instances
 t.register --o input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2004-01-01 00:00:00" increment="3 months"
 
-t.vect.observe.strds --o input=prec strds=precip_abs1 output=prec_observer vector=prec_observer 
+t.vect.observe.strds --o input=prec strds=precip_abs1 output=prec_observer vector=prec_observer column=observation
 t.vect.list input=prec_observer
 t.vect.db.select input=prec_observer
 t.vect.db.select input=prec_observer where="cat = 1" separator="  |  "

+ 1 - 1
temporal/t.vect.extract/test.t.vect.extract.layer.sh

@@ -43,5 +43,5 @@ t.remove type=stvds input=prec_observer,test_extract_1,test_extract_2,test_extra
 t.unregister type=vect maps=prec_observer:1,prec_observer:2,prec_observer:3,prec_observer:4,prec_observer:5,prec_observer:6
 
 g.remove vect=prec_observer
-g.mremove -f vect=test_*
+g.mremove -f type=vect pattern=test_*
 g.remove rast=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6

+ 1 - 1
temporal/t.vect.observe.strds/testsuite/test.t.vect.observe.strds.relative.sh

@@ -19,7 +19,7 @@ t.create --o type=strds temporaltype=relative output=precip_abs1 title="A test"
 t.register -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start=0 increment=1 unit=months
 
 # The @test
-t.vect.observe.strds input=prec strds=precip_abs1 output=prec_observer vector=prec_observer
+t.vect.observe.strds input=prec strds=precip_abs1 output=prec_observer vector=prec_observer column=observation
 v.info prec_observer
 t.info type=stvds input=prec_observer
 t.vect.list input=prec_observer