[GRASS-SVN] r51267 - in grass/trunk/temporal: . t.rast.list

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 5 16:39:09 EDT 2012


Author: huhabla
Date: 2012-04-05 13:39:09 -0700 (Thu, 05 Apr 2012)
New Revision: 51267

Added:
   grass/trunk/temporal/t.rast.list/
   grass/trunk/temporal/t.rast.list/t.rast.list.html
   grass/trunk/temporal/t.rast.list/t.rast.list.py
   grass/trunk/temporal/t.rast.list/test.t.rast.list.sh
Removed:
   grass/trunk/temporal/t.rast.list/test.tr.list.sh
   grass/trunk/temporal/t.rast.list/tr.list.html
   grass/trunk/temporal/t.rast.list/tr.list.py
Modified:
   grass/trunk/temporal/t.rast.list/Makefile
Log:
Using new naming scheme


Modified: grass/trunk/temporal/t.rast.list/Makefile
===================================================================
--- grass/trunk/temporal/tr.list/Makefile	2012-04-04 21:20:55 UTC (rev 51264)
+++ grass/trunk/temporal/t.rast.list/Makefile	2012-04-05 20:39:09 UTC (rev 51267)
@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../../
 
-PGM = tr.list
+PGM = t.rast.list
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 

Copied: grass/trunk/temporal/t.rast.list/t.rast.list.html (from rev 51264, grass/trunk/temporal/tr.list/tr.list.html)
===================================================================
Copied: grass/trunk/temporal/t.rast.list/t.rast.list.py (from rev 51264, grass/trunk/temporal/tr.list/tr.list.py)
===================================================================
--- grass/trunk/temporal/t.rast.list/t.rast.list.py	                        (rev 0)
+++ grass/trunk/temporal/t.rast.list/t.rast.list.py	2012-04-05 20:39:09 UTC (rev 51267)
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+############################################################################
+#
+# MODULE:	t.rast.list
+# AUTHOR(S):	Soeren Gebbert
+#               
+# PURPOSE:	List registered maps of a space time raster dataset 
+# COPYRIGHT:	(C) 2011 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (version 2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+#############################################################################
+
+#%module
+#% description: List registered maps of a space time raster dataset 
+#% keywords: temporal
+#% keywords: raster
+#% keywords: list
+#%end
+
+#%option G_OPT_STRDS_INPUT
+#%end
+
+#%option
+#% key: order
+#% type: string
+#% description: Order the space time dataset by category. 
+#% required: no
+#% multiple: yes
+#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max 
+#% answer: start_time
+#%end
+
+#%option
+#% key: columns
+#% type: string
+#% description: Select columns to be printed to stdout 
+#% required: no
+#% multiple: yes
+#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max 
+#% answer: name,mapset,start_time,end_time
+#%end
+
+#%option G_OPT_T_WHERE
+#%end
+
+#%option
+#% key: method
+#% type: string
+#% description: Which method should be used for data listing
+#% required: no
+#% multiple: no
+#% options: cols,comma,delta,deltagaps,gran
+#% answer: cols
+#%end
+
+#%option
+#% key: fs
+#% type: string
+#% description: The field separator character between the columns, default is tabular "\t"
+#% required: no
+#%end
+
+#%flag
+#% key: h
+#% description: Print column names 
+#%end
+
+import grass.script as grass
+import grass.temporal as tgis
+
+############################################################################
+
+def main():
+
+    # Get the options
+    input = options["input"]
+    columns = options["columns"]
+    order = options["order"]
+    where = options["where"]
+    separator = options["fs"]
+    method = options["method"]
+    header = flags["h"]
+
+    # Make sure the temporal database exists
+    tgis.create_temporal_database()
+
+    tgis.list_maps_of_stds("strds", input, columns, order, where, separator, method, header)
+
+if __name__ == "__main__":
+    options, flags = grass.parser()
+    main()

Copied: grass/trunk/temporal/t.rast.list/test.t.rast.list.sh (from rev 51264, grass/trunk/temporal/tr.list/test.tr.list.sh)
===================================================================
--- grass/trunk/temporal/t.rast.list/test.t.rast.list.sh	                        (rev 0)
+++ grass/trunk/temporal/t.rast.list/test.t.rast.list.sh	2012-04-05 20:39:09 UTC (rev 51267)
@@ -0,0 +1,120 @@
+# This is a test to list raster maps of a space time raster dataset
+
+# We need to set a specific region in the
+# @preprocess step of this test. We generate
+# raster maps with r.mapcalc and create a space time raster datasets
+# 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 = rand(0, 550)"
+r.mapcalc --o expr="prec_2 = rand(0, 450)"
+r.mapcalc --o expr="prec_3 = rand(0, 320)"
+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)"
+
+n1=`g.tempfile pid=1 -d` 
+n2=`g.tempfile pid=2 -d`
+n3=`g.tempfile pid=3 -d`
+n4=`g.tempfile pid=4 -d`
+n5=`g.tempfile pid=5 -d`
+
+cat > "${n1}" << EOF
+prec_1
+prec_2
+prec_3
+prec_4
+prec_5
+prec_6
+EOF
+
+cat > "${n2}" << EOF
+prec_1|2001-01-01
+prec_2|2001-02-01
+prec_3|2001-03-01
+prec_4|2001-04-01
+prec_5|2001-05-01
+prec_6|2001-06-01
+EOF
+
+cat > "${n3}" << EOF
+prec_1|2001-01-01|2001-04-01
+prec_2|2001-05-01|2001-07-01
+prec_3|2001-08-01|2001-10-01
+prec_4|2001-11-01|2002-01-01
+prec_5|2002-02-01|2002-04-01
+prec_6|2002-05-01|2002-07-01
+EOF
+
+cat > "${n4}" << EOF
+prec_1|2001-01-01|2001-07-01
+prec_2|2001-02-01|2001-04-01
+prec_3|2001-03-01|2001-04-01
+prec_4|2001-04-01|2001-06-01
+prec_5|2001-05-01|2001-06-01
+prec_6|2001-06-01|2001-07-01
+EOF
+
+cat > "${n5}" << EOF
+prec_1|2001-01-01|2001-03-11
+prec_2|2001-02-01|2001-04-01
+prec_3|2001-03-01|2001-06-02
+prec_4|2001-04-01|2001-04-01
+prec_5|2001-05-01|2001-05-01
+prec_6|2001-06-01|2001-07-01
+EOF
+
+t.create --o type=strds temporaltype=absolute output=precip_abs0 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs2 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs3 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs4 title="A test with input files" descr="A test with input files"
+t.create --o type=strds temporaltype=absolute output=precip_abs5 title="A test with input files" descr="A test with input files"
+
+# The @test
+t.register type=rast -i input=precip_abs0 file="${n1}" start="2001-01-01" increment="1 months"
+t.rast.list    fs=" | " method=comma     input=precip_abs0
+t.rast.list -h input=precip_abs1
+t.rast.list -h fs=" | " method=cols      input=precip_abs0
+t.rast.list -h fs=" | " method=delta     input=precip_abs0
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs0
+t.rast.list -h fs=" | " method=gran      input=precip_abs0
+
+t.register type=rast    input=precip_abs1 file="${n1}" start="2001-01-01" increment="1 months"
+t.rast.list    fs=" | " method=comma     input=precip_abs1
+t.rast.list -h input=precip_abs1
+t.rast.list -h fs=" | " method=cols      input=precip_abs1
+t.rast.list -h fs=" | " method=delta     input=precip_abs1
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs1
+t.rast.list -h fs=" | " method=gran      input=precip_abs1
+
+t.register type=rast -i input=precip_abs2 file="${n2}" 
+t.rast.list    fs=" | " method=comma     input=precip_abs2
+t.rast.list -h input=precip_abs2
+t.rast.list -h fs=" | " method=cols      input=precip_abs2
+t.rast.list -h fs=" | " method=delta     input=precip_abs2
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs2
+t.rast.list -h fs=" | " method=gran      input=precip_abs2
+
+t.register type=rast -i input=precip_abs3 file="${n3}"
+t.rast.list    fs=" | " method=comma     input=precip_abs3
+t.rast.list -h fs=" | " method=delta     input=precip_abs3
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs3
+t.rast.list -h fs=" | " method=gran      input=precip_abs3
+
+t.register type=rast -i input=precip_abs4 file="${n4}"
+t.rast.list    fs=" | " method=comma     input=precip_abs4
+t.rast.list -h fs=" | " method=delta     input=precip_abs4
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs4
+t.rast.list -h fs=" | " method=gran      input=precip_abs4
+
+t.register type=rast -i input=precip_abs5 file="${n5}"
+t.rast.list    fs=" | " method=comma     input=precip_abs5
+t.rast.list -h input=precip_abs5
+t.rast.list -h fs=" | " method=cols      input=precip_abs5
+t.rast.list -h fs=" | " method=delta     input=precip_abs5
+t.rast.list -h fs=" | " method=deltagaps input=precip_abs5
+t.rast.list -h fs=" | " method=gran      input=precip_abs5
+
+t.unregister type=rast maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
+t.remove type=strds input=precip_abs0,precip_abs1,precip_abs2,precip_abs3,precip_abs4,precip_abs5

Deleted: grass/trunk/temporal/t.rast.list/test.tr.list.sh
===================================================================
--- grass/trunk/temporal/tr.list/test.tr.list.sh	2012-04-04 21:20:55 UTC (rev 51264)
+++ grass/trunk/temporal/t.rast.list/test.tr.list.sh	2012-04-05 20:39:09 UTC (rev 51267)
@@ -1,120 +0,0 @@
-# This is a test to list raster maps of a space time raster dataset
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc and create a space time raster datasets
-# 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 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-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)"
-
-n1=`g.tempfile pid=1 -d` 
-n2=`g.tempfile pid=2 -d`
-n3=`g.tempfile pid=3 -d`
-n4=`g.tempfile pid=4 -d`
-n5=`g.tempfile pid=5 -d`
-
-cat > "${n1}" << EOF
-prec_1
-prec_2
-prec_3
-prec_4
-prec_5
-prec_6
-EOF
-
-cat > "${n2}" << EOF
-prec_1|2001-01-01
-prec_2|2001-02-01
-prec_3|2001-03-01
-prec_4|2001-04-01
-prec_5|2001-05-01
-prec_6|2001-06-01
-EOF
-
-cat > "${n3}" << EOF
-prec_1|2001-01-01|2001-04-01
-prec_2|2001-05-01|2001-07-01
-prec_3|2001-08-01|2001-10-01
-prec_4|2001-11-01|2002-01-01
-prec_5|2002-02-01|2002-04-01
-prec_6|2002-05-01|2002-07-01
-EOF
-
-cat > "${n4}" << EOF
-prec_1|2001-01-01|2001-07-01
-prec_2|2001-02-01|2001-04-01
-prec_3|2001-03-01|2001-04-01
-prec_4|2001-04-01|2001-06-01
-prec_5|2001-05-01|2001-06-01
-prec_6|2001-06-01|2001-07-01
-EOF
-
-cat > "${n5}" << EOF
-prec_1|2001-01-01|2001-03-11
-prec_2|2001-02-01|2001-04-01
-prec_3|2001-03-01|2001-06-02
-prec_4|2001-04-01|2001-04-01
-prec_5|2001-05-01|2001-05-01
-prec_6|2001-06-01|2001-07-01
-EOF
-
-t.create --o type=strds temporaltype=absolute output=precip_abs0 title="A test with input files" descr="A test with input files"
-t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test with input files" descr="A test with input files"
-t.create --o type=strds temporaltype=absolute output=precip_abs2 title="A test with input files" descr="A test with input files"
-t.create --o type=strds temporaltype=absolute output=precip_abs3 title="A test with input files" descr="A test with input files"
-t.create --o type=strds temporaltype=absolute output=precip_abs4 title="A test with input files" descr="A test with input files"
-t.create --o type=strds temporaltype=absolute output=precip_abs5 title="A test with input files" descr="A test with input files"
-
-# The @test
-t.register type=rast -i input=precip_abs0 file="${n1}" start="2001-01-01" increment="1 months"
-tr.list    fs=" | " method=comma     input=precip_abs0
-tr.list -h input=precip_abs1
-tr.list -h fs=" | " method=cols      input=precip_abs0
-tr.list -h fs=" | " method=delta     input=precip_abs0
-tr.list -h fs=" | " method=deltagaps input=precip_abs0
-tr.list -h fs=" | " method=gran      input=precip_abs0
-
-t.register type=rast    input=precip_abs1 file="${n1}" start="2001-01-01" increment="1 months"
-tr.list    fs=" | " method=comma     input=precip_abs1
-tr.list -h input=precip_abs1
-tr.list -h fs=" | " method=cols      input=precip_abs1
-tr.list -h fs=" | " method=delta     input=precip_abs1
-tr.list -h fs=" | " method=deltagaps input=precip_abs1
-tr.list -h fs=" | " method=gran      input=precip_abs1
-
-t.register type=rast -i input=precip_abs2 file="${n2}" 
-tr.list    fs=" | " method=comma     input=precip_abs2
-tr.list -h input=precip_abs2
-tr.list -h fs=" | " method=cols      input=precip_abs2
-tr.list -h fs=" | " method=delta     input=precip_abs2
-tr.list -h fs=" | " method=deltagaps input=precip_abs2
-tr.list -h fs=" | " method=gran      input=precip_abs2
-
-t.register type=rast -i input=precip_abs3 file="${n3}"
-tr.list    fs=" | " method=comma     input=precip_abs3
-tr.list -h fs=" | " method=delta     input=precip_abs3
-tr.list -h fs=" | " method=deltagaps input=precip_abs3
-tr.list -h fs=" | " method=gran      input=precip_abs3
-
-t.register type=rast -i input=precip_abs4 file="${n4}"
-tr.list    fs=" | " method=comma     input=precip_abs4
-tr.list -h fs=" | " method=delta     input=precip_abs4
-tr.list -h fs=" | " method=deltagaps input=precip_abs4
-tr.list -h fs=" | " method=gran      input=precip_abs4
-
-t.register type=rast -i input=precip_abs5 file="${n5}"
-tr.list    fs=" | " method=comma     input=precip_abs5
-tr.list -h input=precip_abs5
-tr.list -h fs=" | " method=cols      input=precip_abs5
-tr.list -h fs=" | " method=delta     input=precip_abs5
-tr.list -h fs=" | " method=deltagaps input=precip_abs5
-tr.list -h fs=" | " method=gran      input=precip_abs5
-
-t.unregister type=rast maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.remove type=strds input=precip_abs0,precip_abs1,precip_abs2,precip_abs3,precip_abs4,precip_abs5

Deleted: grass/trunk/temporal/t.rast.list/tr.list.html
===================================================================
Deleted: grass/trunk/temporal/t.rast.list/tr.list.py
===================================================================
--- grass/trunk/temporal/tr.list/tr.list.py	2012-04-04 21:20:55 UTC (rev 51264)
+++ grass/trunk/temporal/t.rast.list/tr.list.py	2012-04-05 20:39:09 UTC (rev 51267)
@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tr.list
-# AUTHOR(S):	Soeren Gebbert
-#               
-# PURPOSE:	List registered maps of a space time raster dataset 
-# COPYRIGHT:	(C) 2011 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (version 2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%module
-#% description: List registered maps of a space time raster dataset 
-#% keywords: temporal
-#% keywords: raster
-#% keywords: list
-#%end
-
-#%option G_OPT_STRDS_INPUT
-#%end
-
-#%option
-#% key: order
-#% type: string
-#% description: Order the space time dataset by category. 
-#% required: no
-#% multiple: yes
-#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max 
-#% answer: start_time
-#%end
-
-#%option
-#% key: columns
-#% type: string
-#% description: Select columns to be printed to stdout 
-#% required: no
-#% multiple: yes
-#% options: id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max 
-#% answer: name,mapset,start_time,end_time
-#%end
-
-#%option G_OPT_T_WHERE
-#%end
-
-#%option
-#% key: method
-#% type: string
-#% description: Which method should be used for data listing
-#% required: no
-#% multiple: no
-#% options: cols,comma,delta,deltagaps,gran
-#% answer: cols
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character between the columns, default is tabular "\t"
-#% required: no
-#%end
-
-#%flag
-#% key: h
-#% description: Print column names 
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    input = options["input"]
-    columns = options["columns"]
-    order = options["order"]
-    where = options["where"]
-    separator = options["fs"]
-    method = options["method"]
-    header = flags["h"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-
-    tgis.list_maps_of_stds("strds", input, columns, order, where, separator, method, header)
-
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()



More information about the grass-commit mailing list