[GRASS-SVN] r64350 - grass/trunk/temporal/t.rast.what

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 28 15:02:17 PST 2015


Author: huhabla
Date: 2015-01-28 15:02:17 -0800 (Wed, 28 Jan 2015)
New Revision: 64350

Modified:
   grass/trunk/temporal/t.rast.what/t.rast.what.html
   grass/trunk/temporal/t.rast.what/t.rast.what.py
Log:
temporal modules: Disabled several r.what flags, documentation update


Modified: grass/trunk/temporal/t.rast.what/t.rast.what.html
===================================================================
--- grass/trunk/temporal/t.rast.what/t.rast.what.html	2015-01-28 22:39:56 UTC (rev 64349)
+++ grass/trunk/temporal/t.rast.what/t.rast.what.html	2015-01-28 23:02:17 UTC (rev 64350)
@@ -1,21 +1,29 @@
 <h2>DESCRIPTION</h2>
 
 <em>t.rast.what</em> is designed to sample space time raster datasets
-at specific coordinates using <a href="r.what.html">r.what</a> internally. 
+at specific point coordinates from a vector map layer 
+using <a href="r.what.html">r.what</a> internally. 
 The output of <a href="r.what.html">r.what</a> 
-is transformed in different output layouts.
-The output layouts can be specified using the option <em>layout</em>.
-Please have a look at the output layout demonstration in the example.
+is transformed to different output layouts.
+The output layouts can be specified using the <em>layout</em> option.
 <p>
+Three layouts can be specified:
+<ul>
+    <li><em>row</em> - Row order, one vector sample point value per row</li>
+    <li><em>col</em> - Column order, create a column for each vector sample point of a single time step/raster layer</li>
+    <li><em>timerow</em> - Time order, create a column for each time step, this order is the original r.what output, except that the column names are the time stamps</li>
+</ul>
+
+Please have a look at the example to see the supported layouts.
+<p>
 This module is designed to run several instances of r.what to sample
-parts of a space time raster dataset in parallel. Several intermediate
-text files will be produces that are merged into a single file at the
-and of the processing.
+subsets of a space time raster dataset in parallel. Several intermediate
+text files will be created that are merged into a single file at the
+end of the processing.
 <p>
-Coordinates can be provided using the <em>coordinates</em> option
-or as vector map using the <em>points</em> option.
+Coordinates must be provided as vector map using the <em>points</em> option.
 <p>
-An output file must be provided with the <em>output</em> option.
+An output file must be specified using the <em>output</em> option.
     
 <h2>EXAMPLE</h2>
 
@@ -24,7 +32,7 @@
 of all layout options are demonstrated. 
 
 <div class="code"><pre>
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
+g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10
 
 # Generate data
 r.mapcalc expr="a_1 = 1" -s
@@ -32,6 +40,7 @@
 r.mapcalc expr="a_3 = 3" -s
 r.mapcalc expr="a_4 = 4" -s
 
+# Vector points for sampling
 v.random output=points n=3
 
 t.create type=strds output=A title="A test" descr="A test"
@@ -39,7 +48,7 @@
 t.register -i type=raster input=A maps=a_1,a_2,a_3,a_4 \
     start='1990-01-01' increment="1 month"
 
-# Now we create 3 outputs of the same data using different layouts
+# Create 3 output files of the same data using different layouts
 
 # Output in "row" order
 t.rast.what strds=A points=points output=result.txt layout=row -n
@@ -71,15 +80,17 @@
 1990-03-01 00:00:00|1990-04-01 00:00:00|3|3|3
 1990-04-01 00:00:00|1990-05-01 00:00:00|4|4|4
 
-# Output in one time series per row order
-t.rast.what strds=A points=points output=result.txt layout=timerow -n
+# Output in "timerow" order, one time series per row 
+# using the where statement to select a subset of the STRDS
+t.rast.what strds=A points=points output=result.txt \
+    where="start_time >= '1990-03-01'" layout=timerow -n
 
 cat result.txt
 
-x|y|1990-01-01 00:00:00;1990-02-01 00:00:00|1990-02-01 00:00:00;1990-03-01 00:00:00|1990-03-01 00:00:00;1990-04-01 00:00:00|1990-04-01 00:00:00;1990-05-01 00:00:00
-107.976195095579|14.4780172666265|1|2|3|4
-48.1672585088805|75.5186797967386|1|2|3|4
-114.394437197952|36.2390227089844|1|2|3|4
+x|y|1990-03-01 00:00:00;1990-04-01 00:00:00|1990-04-01 00:00:00;1990-05-01 00:00:00
+87.1990551431732|47.8023402837766|3|4
+111.822716201101|60.8478739587795|3|4
+33.1868681892585|14.4679757612965|3|4
 </pre></div>
 
 <h2>SEE ALSO</h2>

Modified: grass/trunk/temporal/t.rast.what/t.rast.what.py
===================================================================
--- grass/trunk/temporal/t.rast.what/t.rast.what.py	2015-01-28 22:39:56 UTC (rev 64349)
+++ grass/trunk/temporal/t.rast.what/t.rast.what.py	2015-01-28 23:02:17 UTC (rev 64350)
@@ -5,8 +5,9 @@
 # MODULE:       t.rast.what
 # AUTHOR(S):    Soeren Gebbert
 #
-# PURPOSE:      Sample a space time raster dataset at specific coordinates 
-#               and write the output to stdout using different layouts
+# PURPOSE:      Sample a space time raster dataset at specific vector point 
+#               coordinates and write the output to stdout using different 
+#               layouts
 #               
 # COPYRIGHT:    (C) 2015 by the GRASS Development Team
 #
@@ -17,7 +18,7 @@
 #############################################################################
 
 #%module
-#% description: Sample a space time raster dataset at specific coordinates and write the output to stdout using different layouts
+#% description: Sample a space time raster dataset at specific vector point coordinates and write the output to stdout using different layouts
 #% keyword: temporal
 #% keyword: raster
 #% keyword: sampling
@@ -77,6 +78,7 @@
 #% description: Output header row
 #%end
 
+## Temporary disabled the r.what flags due to test issues
 ##%flag
 ##% key: f
 ##% description: Show the category labels of the grid cell(s)
@@ -146,7 +148,7 @@
     if separator == "newline":
         separator = "\n"
 
-    # Setup flags
+    # Setup flags are disabled due to test issues
     flags = ""
     #if output_cat_label is True:
     #    flags += "f"
@@ -375,7 +377,7 @@
 
     out_file.write(header + "\n")
 
-    gscript.message(_("Writing the output file %s"%(output)))
+    gscript.message(_("Writing the output file <%s>"%(output)))
     for row in matrix:
         first = True
         for col in row:



More information about the grass-commit mailing list