[GRASS-SVN] r48846 - in grass/trunk/temporal: t.create t.support t.time.abs t.time.rel tr.aggregate tr.extract tr.list tr.register tr.series tr3.register tv.register

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 18 09:10:27 EDT 2011


Author: huhabla
Date: 2011-10-18 06:10:27 -0700 (Tue, 18 Oct 2011)
New Revision: 48846

Modified:
   grass/trunk/temporal/t.create/t.create.py
   grass/trunk/temporal/t.support/test.t.support.sh
   grass/trunk/temporal/t.time.abs/test.t.time.abs.file.sh
   grass/trunk/temporal/t.time.abs/test.t.time.abs.sh
   grass/trunk/temporal/t.time.rel/test.t.time.rel.file.sh
   grass/trunk/temporal/t.time.rel/test.t.time.rel.sh
   grass/trunk/temporal/tr.aggregate/test.tr.aggregate.sh
   grass/trunk/temporal/tr.aggregate/tr.aggregate.py
   grass/trunk/temporal/tr.extract/test.tr.extract.sh
   grass/trunk/temporal/tr.extract/tr.extract.py
   grass/trunk/temporal/tr.list/test.tr.list.sh
   grass/trunk/temporal/tr.register/register_ECAD_maps_temp_mean_1995_2010.py
   grass/trunk/temporal/tr.register/test.tr.register.file.sh
   grass/trunk/temporal/tr.register/test.tr.register.sh
   grass/trunk/temporal/tr.series/test.tr.series.sh
   grass/trunk/temporal/tr3.register/test.tr3.register.sh
   grass/trunk/temporal/tv.register/test.tv.register.sh
Log:
Temporal granularity is now computed from registered maps.


Modified: grass/trunk/temporal/t.create/t.create.py
===================================================================
--- grass/trunk/temporal/t.create/t.create.py	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.create/t.create.py	2011-10-18 13:10:27 UTC (rev 48846)
@@ -30,14 +30,6 @@
 #%end
 
 #%option
-#% key: granularity
-#% type: string
-#% description: The granularity of the new space time dataset (NNN day, NNN week, NNN month)
-#% required: yes
-#% multiple: no
-#%end
-
-#%option
 #% key: semantictype
 #% type: string
 #% description: The semantic type of the space time dataset
@@ -95,7 +87,6 @@
     title = options["title"]
     descr = options["description"]
     semantic = options["semantictype"]
-    gran = options["granularity"]
 
     # Make sure the temporal database exists
     tgis.create_temporal_database()
@@ -121,7 +112,7 @@
 
     grass.verbose(_("Create space time %s dataset.") % sp.get_new_map_instance(None).get_type())
 
-    sp.set_initial_values(granularity=gran, temporal_type=temporaltype, semantic_type=semantic, title=title, description=descr)
+    sp.set_initial_values(temporal_type=temporaltype, semantic_type=semantic, title=title, description=descr)
     sp.insert(dbif)
 
     dbif.close()

Modified: grass/trunk/temporal/t.support/test.t.support.sh
===================================================================
--- grass/trunk/temporal/t.support/test.t.support.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.support/test.t.support.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -1,15 +1,15 @@
 # We create several space time raster datasets
 
 # A simple space ime raster datasets creation and unpdate @test with absolute time
-t.create --v --o type=strds temporaltype=absolute output=precip_abs1 gran="5 senconds" title="Test" descr="This is the 1 test strds" semantictype=event
+t.create --v --o type=strds temporaltype=absolute output=precip_abs1 title="Test" descr="This is the 1 test strds" semantictype=event
 t.info type=strds input=precip_abs1
-t.support --v type=strds input=precip_abs1 gran="5 hours" title="Test support" descr="This is the support test strds" semantictype=const
+t.support --v type=strds input=precip_abs1 title="Test support" descr="This is the support test strds" semantictype=const
 t.info type=strds input=precip_abs1
 
 # A simple space ime raster datasets creation and update @test with relative time
-t.create --v --o type=strds temporaltype=relative output=precip_rel1 gran=5  title="Test" descr="This is the 1 test strds" semantictype=event
+t.create --v --o type=strds temporaltype=relative output=precip_rel1 title="Test" descr="This is the 1 test strds" semantictype=event
 t.info type=strds input=precip_rel1
-t.support --v type=strds input=precip_rel1 gran=3 title="Test support" descr="This is the support test strds" semantictype=continuous
+t.support --v type=strds input=precip_rel1 title="Test support" descr="This is the support test strds" semantictype=continuous
 t.info type=strds input=precip_rel1
 
 t.remove --v type=strds input=precip_abs1,precip_rel1

Modified: grass/trunk/temporal/t.time.abs/test.t.time.abs.file.sh
===================================================================
--- grass/trunk/temporal/t.time.abs/test.t.time.abs.file.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.time.abs/test.t.time.abs.file.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -49,7 +49,7 @@
 
 # The first @test
 # We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=absolute output=precip_abs8 gran="1 months" title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs8 title="A test with input files" descr="A test with input files"
 
 # Test with input files
 # File 1

Modified: grass/trunk/temporal/t.time.abs/test.t.time.abs.sh
===================================================================
--- grass/trunk/temporal/t.time.abs/test.t.time.abs.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.time.abs/test.t.time.abs.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -13,9 +13,9 @@
 r.mapcalc --o expr="prec_5 = rand(0, 300)"
 r.mapcalc --o expr="prec_6 = rand(0, 650)"
 
-t.create --v --o type=strds temporaltype=absolute output=precip_abs1 gran="1 months" title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=absolute output=precip_abs2 gran="1 months" title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=absolute output=precip_abs3 gran="1 months" title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=absolute output=precip_abs3 title="A test" descr="A test"
 
 t.time.abs --v input=prec_1,prec_2,prec_3 start="2001-01-01" increment="1 months"
 t.info type=rast input=prec_1

Modified: grass/trunk/temporal/t.time.rel/test.t.time.rel.file.sh
===================================================================
--- grass/trunk/temporal/t.time.rel/test.t.time.rel.file.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.time.rel/test.t.time.rel.file.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -49,7 +49,7 @@
 
 # The first @test
 # We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=relative output=precip_rel gran=1 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=relative output=precip_rel title="A test with input files" descr="A test with input files"
 
 # Test with input files
 # File 1

Modified: grass/trunk/temporal/t.time.rel/test.t.time.rel.sh
===================================================================
--- grass/trunk/temporal/t.time.rel/test.t.time.rel.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/t.time.rel/test.t.time.rel.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -13,9 +13,9 @@
 r.mapcalc --o expr="prec_5 = rand(0, 300)"
 r.mapcalc --o expr="prec_6 = rand(0, 650)"
 
-t.create --v --o type=strds temporaltype=relative output=precip_rel1 gran=2 title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=relative output=precip_rel2 gran=2 title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=relative output=precip_rel3 gran=2 title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=relative output=precip_rel1 title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=relative output=precip_rel2 title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=relative output=precip_rel3 title="A test" descr="A test"
 
 t.time.rel --v input=prec_1,prec_2,prec_3 start=5 increment=2
 t.info type=rast input=prec_1

Modified: grass/trunk/temporal/tr.aggregate/test.tr.aggregate.sh
===================================================================
--- grass/trunk/temporal/tr.aggregate/test.tr.aggregate.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.aggregate/test.tr.aggregate.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -14,7 +14,7 @@
 r.mapcalc --o expr="prec_5 = rand(0, 300)"
 r.mapcalc --o expr="prec_6 = rand(0, 650)"
 
-t.create --o type=strds temporaltype=absolute output=precip_abs1 gran="3 months" title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
 tr.register --v -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-15 12:05:45" increment="14 days"
 
 # The first @test

Modified: grass/trunk/temporal/tr.aggregate/tr.aggregate.py
===================================================================
--- grass/trunk/temporal/tr.aggregate/tr.aggregate.py	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.aggregate/tr.aggregate.py	2011-10-18 13:10:27 UTC (rev 48846)
@@ -141,8 +141,8 @@
             dbif.close()
             grass.fatal(_("Space time raster dataset <%s> is already in database, use overwrite flag to overwrite") % out_id)
 
-    granularity, temporal_type, semantic_type, title, description = sp.get_initial_values()
-    new_sp.set_initial_values(gran, temporal_type, semantic_type, title, description)
+    temporal_type, semantic_type, title, description = sp.get_initial_values()
+    new_sp.set_initial_values(temporal_type, semantic_type, title, description)
     new_sp.insert(dbif)
 
     rows = sp.get_registered_maps("id,start_time", where, "start_time", dbif)

Modified: grass/trunk/temporal/tr.extract/test.tr.extract.sh
===================================================================
--- grass/trunk/temporal/tr.extract/test.tr.extract.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.extract/test.tr.extract.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -14,7 +14,7 @@
 r.mapcalc --o expr="prec_5 = rand(0, 300)"
 r.mapcalc --o expr="prec_6 = rand(0, 650)"
 
-t.create --o type=strds temporaltype=absolute output=precip_abs1 gran="3 months" title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
 tr.register -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="3 months"
 
 # The first @test

Modified: grass/trunk/temporal/tr.extract/tr.extract.py
===================================================================
--- grass/trunk/temporal/tr.extract/tr.extract.py	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.extract/tr.extract.py	2011-10-18 13:10:27 UTC (rev 48846)
@@ -113,8 +113,8 @@
         else:
             grass.fatal(_("Space time raster dataset <%s> is already in database, use overwrite flag to overwrite") % out_id)
 
-    granularity, temporal_type, semantic_type, title, description = sp.get_initial_values()
-    new_sp.set_initial_values(granularity, temporal_type, semantic_type, title, description)
+    temporal_type, semantic_type, title, description = sp.get_initial_values()
+    new_sp.set_initial_values(temporal_type, semantic_type, title, description)
     new_sp.insert(dbif)
 
     rows = sp.get_registered_maps("id", where, "start_time", dbif)

Modified: grass/trunk/temporal/tr.list/test.tr.list.sh
===================================================================
--- grass/trunk/temporal/tr.list/test.tr.list.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.list/test.tr.list.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -12,7 +12,7 @@
 r.mapcalc --o expr="prec_4 = rand(0, 510)"
 r.mapcalc --o expr="prec_5 = rand(0, 300)"
 r.mapcalc --o expr="prec_6 = rand(0, 650)"
-t.create --o type=strds temporaltype=absolute dataset=precip_abs1 gran="1 senconds" title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute dataset=precip_abs1 title="A test" descr="A test"
 
 tr.register -i dataset=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="2 months"
 t.info type=strds dataset=precip_abs1

Modified: grass/trunk/temporal/tr.register/register_ECAD_maps_temp_mean_1995_2010.py
===================================================================
--- grass/trunk/temporal/tr.register/register_ECAD_maps_temp_mean_1995_2010.py	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.register/register_ECAD_maps_temp_mean_1995_2010.py	2011-10-18 13:10:27 UTC (rev 48846)
@@ -4,10 +4,10 @@
 import grass.script as grass
 
 # Create the space time raster dataset with t.create
-#dataset = "temp_mean_1995_2010_daily"
-dataset = "temp_mean_1995_1996_daily"
+dataset = "temp_mean_1995_2010_daily"
+#dataset = "temp_mean_1995_1996_daily"
 
-grass.run_command("t.create", type="strds", dataset=dataset, granularity="1 days", \
+grass.run_command("t.create", type="strds", output=dataset, granularity="1 days", \
                   semantic="continuous", temporal="absolute", \
 		  title="European mean temperature 1995-2010", \
 		  description="The european daily mean temperature 1995 - 2010 from ECA&D ", \
@@ -15,8 +15,8 @@
 
 name = "temp_mean."
 maps=""
-#for i in range(5844):
-for i in range(365):
+for i in range(5844):
+#for i in range(365):
     inc = i + 1
     map_name = name + str(inc)
     if i == 0:
@@ -25,4 +25,4 @@
         maps += "," + map_name
     
 # Register all maps at once
-grass.run_command("tr.register", flags="i", dataset=dataset, maps=maps, start="1995-01-01", increment="1 days", overwrite=True)
+grass.run_command("tr.register", flags="i", input=dataset, maps=maps, start="1995-01-01", increment="1 days", overwrite=True)

Modified: grass/trunk/temporal/tr.register/test.tr.register.file.sh
===================================================================
--- grass/trunk/temporal/tr.register/test.tr.register.file.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.register/test.tr.register.file.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -53,7 +53,7 @@
 
 # The first @test
 # We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=absolute output=precip_abs8 gran="1 months" title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs8 title="A test with input files" descr="A test with input files"
 
 # Test with input files
 # File 1

Modified: grass/trunk/temporal/tr.register/test.tr.register.sh
===================================================================
--- grass/trunk/temporal/tr.register/test.tr.register.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.register/test.tr.register.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -20,13 +20,13 @@
 # The first @test
 # We create the space time raster inputs and register the raster maps with absolute time interval
 
-t.create --o type=strds temporaltype=absolute output=precip_abs1 gran="1 senconds" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs2 gran="1 minutes" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs3 gran="1 hours" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs4 gran="1 days" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs5 gran="1 weeks" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs6 gran="1 months" title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs7 gran="1 years" title="A test" descr="A test"
+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=strds temporaltype=absolute output=precip_abs3 title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs4 title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs5 title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs6 title="A test" descr="A test"
+t.create --o type=strds temporaltype=absolute output=precip_abs7 title="A test" descr="A test"
 
 tr.register -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 seconds"
 t.info type=strds input=precip_abs1
@@ -79,5 +79,5 @@
 t.topology -t input=precip_abs7
 
 t.remove --v type=rast input=prec_1,prec_2,prec_3
-t.remove --v type=strds input=precip_abs1,precip_abs2,precip_abs3,precip_abs4,precip_abs5,precip_abs6,precip_abs7,precip_abs7
+t.remove --v type=strds input=precip_abs1,precip_abs2,precip_abs3,precip_abs4,precip_abs5,precip_abs6,precip_abs7
 t.remove --v type=rast input=prec_4,prec_5,prec_6

Modified: grass/trunk/temporal/tr.series/test.tr.series.sh
===================================================================
--- grass/trunk/temporal/tr.series/test.tr.series.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr.series/test.tr.series.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -20,7 +20,7 @@
 # The first @test
 # We create the space time raster inputs and register the raster maps with absolute time interval
 
-t.create --v --o type=strds temporaltype=absolute output=precip_abs gran="1 months" title="A test" descr="A test"
+t.create --v --o type=strds temporaltype=absolute output=precip_abs title="A test" descr="A test"
 
 tr.register --v input=precip_abs maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 months"
 

Modified: grass/trunk/temporal/tr3.register/test.tr3.register.sh
===================================================================
--- grass/trunk/temporal/tr3.register/test.tr3.register.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tr3.register/test.tr3.register.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -20,13 +20,13 @@
 # The first @test
 # We create the space time raster3d dataset and register the raster3d maps with absolute time interval
 
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs1 gran="1 senconds" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs2 gran="1 minutes" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs3 gran="1 hours" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs4 gran="1 days" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs5 gran="1 weeks" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs6 gran="1 months" title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs7 gran="1 years" title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs1 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs2 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs3 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs4 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs5 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs6 title="A test" descr="A test"
+t.create --v --o type=str3ds temporaltype=absolute output=volume_abs7 title="A test" descr="A test"
 
 tr3.register --v -i input=volume_abs1 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="1 seconds"
 t.info type=str3ds input=volume_abs1

Modified: grass/trunk/temporal/tv.register/test.tv.register.sh
===================================================================
--- grass/trunk/temporal/tv.register/test.tv.register.sh	2011-10-18 13:09:31 UTC (rev 48845)
+++ grass/trunk/temporal/tv.register/test.tv.register.sh	2011-10-18 13:10:27 UTC (rev 48846)
@@ -20,13 +20,13 @@
 # The first @test
 # We create the space time vector inputs and register the vector maps with absolute time interval
 
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds1 gran="1 senconds" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds2 gran="1 minutes" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds3 gran="1 hours" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds4 gran="1 days" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds5 gran="1 weeks" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds6 gran="1 months" title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds7 gran="1 years" title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds1 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds2 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds3 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds4 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds5 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds6 title="A test" descr="A test"
+t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds7 title="A test" descr="A test"
 
 tv.register --v -i input=lidar_abs_ds1 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="1 seconds"
 t.info type=stvds input=lidar_abs_ds1



More information about the grass-commit mailing list