[GRASS-SVN] r52249 - grass/trunk/temporal/t.vect.observe.strds

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 28 04:41:37 PDT 2012


Author: huhabla
Date: 2012-06-28 04:41:37 -0700 (Thu, 28 Jun 2012)
New Revision: 52249

Added:
   grass/trunk/temporal/t.vect.observe.strds/test.t.vect.observe.strds.relative.sh
Modified:
   grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
Log:
Added relative time test. Fixed relative time handling bug.


Modified: grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
===================================================================
--- grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2012-06-28 09:21:39 UTC (rev 52248)
+++ grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2012-06-28 11:41:37 UTC (rev 52249)
@@ -186,7 +186,7 @@
         if out_sp.is_time_absolute():
             vect.set_absolute_time(start, end)
         else:
-            vect.set_relative_time(start, end, strds_ds.get_relative_time_unit())
+            vect.set_relative_time(start, end, strds_sp.get_relative_time_unit())
        
         if vect.is_in_db(dbif):
             vect.update_all(dbif)

Added: grass/trunk/temporal/t.vect.observe.strds/test.t.vect.observe.strds.relative.sh
===================================================================
--- grass/trunk/temporal/t.vect.observe.strds/test.t.vect.observe.strds.relative.sh	                        (rev 0)
+++ grass/trunk/temporal/t.vect.observe.strds/test.t.vect.observe.strds.relative.sh	2012-06-28 11:41:37 UTC (rev 52249)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Test the temporal and spatial sampling/observation of raster maps by vector point maps
+# using relative time
+# We need to set a specific region in the
+# @preprocess step of this test. 
+# The region setting should work for UTM and LL test locations
+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 = 100.0"
+r.mapcalc --o expr="prec_2 = 200.0"
+r.mapcalc --o expr="prec_3 = 300"
+r.mapcalc --o expr="prec_4 = 400"
+r.mapcalc --o expr="prec_5 = 500.0"
+r.mapcalc --o expr="prec_6 = 600.0"
+
+v.random --o -z output=prec n=5 seed=1
+
+t.create --o type=strds temporaltype=relative output=precip_abs1 title="A test" descr="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 
+v.info prec_observer
+t.info type=stvds input=prec_observer
+t.vect.list input=prec_observer
+
+# @postprocess
+t.unregister type=rast maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
+t.remove type=strds input=precip_abs1
+t.remove type=stvds input=prec_observer
+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,test_extract
+g.remove rast=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6


Property changes on: grass/trunk/temporal/t.vect.observe.strds/test.t.vect.observe.strds.relative.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the grass-commit mailing list