[GRASS-SVN] r57095 - in grass/trunk: lib/python/temporal temporal/t.connect temporal/t.create temporal/t.info temporal/t.merge temporal/t.rast.aggregate temporal/t.rast.aggregate.ds temporal/t.rast.export temporal/t.rast.extract temporal/t.rast.gapfill temporal/t.vect.list

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 13 10:53:36 PDT 2013


Author: huhabla
Date: 2013-07-13 10:53:36 -0700 (Sat, 13 Jul 2013)
New Revision: 57095

Modified:
   grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
   grass/trunk/lib/python/temporal/metadata.py
   grass/trunk/lib/python/temporal/stds_export.py
   grass/trunk/temporal/t.connect/t.connect.html
   grass/trunk/temporal/t.create/t.create.html
   grass/trunk/temporal/t.info/t.info.html
   grass/trunk/temporal/t.info/t.info.py
   grass/trunk/temporal/t.merge/t.merge.html
   grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html
   grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
   grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.html
   grass/trunk/temporal/t.rast.export/t.rast.export.html
   grass/trunk/temporal/t.rast.extract/t.rast.extract.html
   grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
   grass/trunk/temporal/t.vect.list/test.t.vect.list.sh
Log:
Documentation update and history print function.


Modified: grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
===================================================================
--- grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -119,6 +119,12 @@
         self.spatial_extent.print_shell_info()
         self.metadata.print_shell_info()
 
+    def print_history(self):
+        """!Print history information about this class in human readable 
+            shell style
+        """
+        self.metadata.print_history()
+        
     def set_initial_values(self, temporal_type, semantic_type,
                            title=None, description=None):
         """!Set the initial values of the space time dataset
@@ -175,7 +181,7 @@
            """
         # The grass module
 
-        command = "- %s -\n"%(str(datetime.today().strftime("%Y-%m-%d %H:%M:%S")))
+        command = "# %s \n"%(str(datetime.today().strftime("%Y-%m-%d %H:%M:%S")))
         command += os.path.basename(sys.argv[0])
 
         # We will wrap the command line to fit into 80 character

Modified: grass/trunk/lib/python/temporal/metadata.py
===================================================================
--- grass/trunk/lib/python/temporal/metadata.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/lib/python/temporal/metadata.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -990,6 +990,37 @@
             for token in command.split("\n"):
                 print " | " + str(token)
 
+    def print_history(self):
+        """!Print history information about this class in human readable 
+            shell style
+        """
+        #      0123456789012345678901234567890
+        print "# Title:"
+        print "# " + str(self.get_title())
+        print "# Description:"
+        print "# " + str(self.get_description())
+        print "# Command history:"
+        command = self.get_command()
+        
+        if command:
+            tokens = command.split("\n")
+            print_list = []
+            for token in tokens:
+                token = str(token).rstrip().lstrip()
+                if len(token) > 1:
+                    print_list.append(token)
+                
+            count = 0
+            for token in print_list:
+                count += 1
+                if len(token) > 1:
+                    if token[0] == "#":
+                        print token
+                    elif count < len(print_list):
+                        print token + " \\"
+                    else:
+                        print token 
+                        
     def print_shell_info(self):
         """!Print information about this class in shell style"""
         print "number_of_maps=" + str(self.get_number_of_maps())

Modified: grass/trunk/lib/python/temporal/stds_export.py
===================================================================
--- grass/trunk/lib/python/temporal/stds_export.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/lib/python/temporal/stds_export.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -368,7 +368,7 @@
     read_file.write("%13s -- Time series file, lists all maps by name "
                     "with interval\n" % (list_file_name))
     read_file.write("                 time stamps in ISO-Format. Field separator is |\n")
-    read_file.write("%13s -- Projection information in PROJ.4 format\n" %
+    read_file.write("%13s -- The output of t.info\n" %
                     (metadata_file_name))
     read_file.write("%13s -- This file\n" % (read_file_name))
     read_file.close()

Modified: grass/trunk/temporal/t.connect/t.connect.html
===================================================================
--- grass/trunk/temporal/t.connect/t.connect.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.connect/t.connect.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -7,7 +7,9 @@
 Values are stored in the mapset's <tt>VAR</tt> file;
 the connection is not tested for validity.
 <p>The <b>-d</b> flag will set the default TGIS connection parameters. 
-A sqlite3 database "tgis.db" will be created in the PERMANET directory of the current location.
+A sqlite3 database "tgis/sqlite.db" will be created in the PERMANET directory 
+of the current location. It will be located in the "tgis" sub-directory to not
+interfere with the sqlite3 database used for vector attribute storage.
 <p>The <b>-p</b> flag will display the current TGIS connection parameters. 
 <p>The <b>-pg</b> flag will display the current TGIS connection parameters using shell style. 
 <p>The <b>-c</b> flag will silently check if the TGIS connection parameters have
@@ -22,7 +24,7 @@
 <h3>SQLite</h3>
 
 <div class="code"><pre>
-t.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/PERMANENT/tgis.db'
+t.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/PERMANENT/tgis/sqlite.db'
 t.connect -p
 t.info -s
 </pre></div>

Modified: grass/trunk/temporal/t.create/t.create.html
===================================================================
--- grass/trunk/temporal/t.create/t.create.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.create/t.create.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -42,52 +42,60 @@
          description="Test dataset with daily precipitation"
 
 t.register -i type=rast input=precipitation_daily \
-           file=map_list.txt start=20-08-2012 increment="1 days"
+           file=map_list.txt start=2012-08-20 increment="1 days"
 
 t.info type=strds input=precipitation_daily
 
  +-------------------- Space Time Raster Dataset -----------------------------+
  |                                                                            |
  +-------------------- Basic information -------------------------------------+
- | Id: ........................ precipitation_daily at PERMANENT
+ | Id: ........................ precipitation_daily at test
  | Name: ...................... precipitation_daily
- | Mapset: .................... PERMANENT
+ | Mapset: .................... test
  | Creator: ................... soeren
- | Creation time: ............. 2012-10-16 00:20:28.920018
+ | Creation time: ............. 2013-07-13 12:18:52.848223
  | Temporal type: ............. absolute
  | Semantic type:.............. mean
  +-------------------- Absolute time -----------------------------------------+
  | Start time:................. 2012-08-27 00:00:00
  | End time:................... 2012-09-03 00:00:00
- | Granularity:................ 1 days
+ | Granularity:................ 1 day
  | Temporal type of maps:...... interval
  +-------------------- Spatial extent ----------------------------------------+
- | North:...................... 70.0
- | South:...................... 0.0
- | East:.. .................... 100.0
- | West:....................... 0.0
+ | North:...................... 80.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
  | Top:........................ 0.0
  | Bottom:..................... 0.0
  +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_daily_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 0.0
+ | Minimum value max:.......... 0.0
+ | Maximum value min:.......... 9.0
+ | Maximum value max:.......... 9.0
  | Number of registered maps:.. 7
+ |
  | Title:
  | Daily precipitation
  | Description:
  | Test dataset with daily precipitation
- | North-South resolution min:. 10.0
- | North-South resolution max:. 10.0
- | East-west resolution min:... 10.0
- | East-west resolution max:... 10.0
- | Minimum value min:.......... 0.0
- | Minimum value max:.......... 0.0
- | Maximum value min:.......... 9.0
- | Maximum value max:.......... 9.0
- | Raster register table:...... precipitation_daily_PERMANENT_raster_register
+ | Command history:
+ | # 2013-07-13 12:18:52 
+ | t.create type="strds" temporaltype="absolute"
+ |     output="precipitation_daily" title="Daily precipitation"
+ |     description="Test dataset with daily precipitation"
+ | # 2013-07-13 12:18:53 
+ | t.register -i type="rast" input="precipitation_daily"
+ |     file="map_list.txt" start="2012-08-20" increment="1 days"
+ | 
  +----------------------------------------------------------------------------+
 </pre></div>
 
-
-
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/trunk/temporal/t.info/t.info.html
===================================================================
--- grass/trunk/temporal/t.info/t.info.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.info/t.info.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -27,10 +27,9 @@
 <div class="code"><pre>
 
 t.info -s
-
  +------------------- Temporal DBMI backend information ----------------------+
  | DBMI Python interface:...... sqlite3
- | DBMI init string:........... /1/soeren/grassdata/TestLL/PERMANENT/tgis.db
+ | DBMI init string:........... /home/soeren/grassdata/Test_ECAD_3/PERMANENT/tgis/sqlite.db
  | SQL template path:.......... /home/soeren/src/grass7.0/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/sql
  +----------------------------------------------------------------------------+
 
@@ -42,7 +41,7 @@
          description="Test dataset with daily precipitation"
 
 t.register -i type=rast input=precipitation_daily \
-           maps=map1 start=20-08-2012 increment="1 days"
+           maps=map1 start=2012-08-20 increment="1 days"
 
 t.info type=rast input=map1
 
@@ -53,7 +52,7 @@
  | Name: ...................... map1
  | Mapset: .................... PERMANENT
  | Creator: ................... soeren
- | Creation time: ............. 2012-10-16 14:45:24.554908
+ | Creation time: ............. 2013-07-13 11:38:19.357300
  | Temporal type: ............. absolute
  +-------------------- Absolute time -----------------------------------------+
  | Start time:................. 2012-08-20 00:00:00
@@ -74,7 +73,7 @@
  | East-west resolution:....... 10.0
  | Minimum value:.............. 0.0
  | Maximum value:.............. 9.0
- | STRDS register table ....... map_989e88525bae40db9c16d03d3574d656_strds_register
+ | STRDS register table ....... map_2db89689ae774e9f929ef693339ae116_strds_register
  | Registered datasets ........ precipitation_daily at PERMANENT
  +----------------------------------------------------------------------------+
 
@@ -83,40 +82,50 @@
  +-------------------- Space Time Raster Dataset -----------------------------+
  |                                                                            |
  +-------------------- Basic information -------------------------------------+
- | Id: ........................ precipitation_daily at PERMANENT
+ | Id: ........................ precipitation_daily at test
  | Name: ...................... precipitation_daily
- | Mapset: .................... PERMANENT
+ | Mapset: .................... test
  | Creator: ................... soeren
- | Creation time: ............. 2012-10-16 14:52:24.093147
+ | Creation time: ............. 2013-07-13 12:16:26.971963
  | Temporal type: ............. absolute
  | Semantic type:.............. mean
  +-------------------- Absolute time -----------------------------------------+
  | Start time:................. 2012-08-20 00:00:00
  | End time:................... 2012-08-21 00:00:00
- | Granularity:................ 1 days
+ | Granularity:................ 1 day
  | Temporal type of maps:...... interval
  +-------------------- Spatial extent ----------------------------------------+
  | North:...................... 80.0
- | South:...................... 0.0
- | East:.. .................... 120.0
- | West:....................... 0.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
  | Top:........................ 0.0
  | Bottom:..................... 0.0
  +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_daily_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 0.0
+ | Minimum value max:.......... 0.0
+ | Maximum value min:.......... 9.0
+ | Maximum value max:.......... 9.0
  | Number of registered maps:.. 1
+ |
  | Title:
  | Daily precipitation
  | Description:
  | Test dataset with daily precipitation
- | North-South resolution min:. 10.0
- | North-South resolution max:. 10.0
- | East-west resolution min:... 10.0
- | East-west resolution max:... 10.0
- | Minimum value min:.......... 0.0
- | Minimum value max:.......... 0.0
- | Maximum value min:.......... 9.0
- | Maximum value max:.......... 9.0
- | Raster register table:...... precipitation_daily_PERMANENT_raster_register
+ | Command history:
+ | # 2013-07-13 12:16:27 
+ | t.create type="strds" temporaltype="absolute"
+ |     output="precipitation_daily" title="Daily precipitation"
+ |     description="Test dataset with daily precipitation"
+ | # 2013-07-13 12:16:27 
+ | t.register -i type="rast" input="precipitation_daily"
+ |     maps="map1" start="2012-08-20" increment="1 days"
+ | 
  +----------------------------------------------------------------------------+
 </pre></div>
 <h2>SEE ALSO</h2>

Modified: grass/trunk/temporal/t.info/t.info.py
===================================================================
--- grass/trunk/temporal/t.info/t.info.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.info/t.info.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -41,6 +41,11 @@
 #%end
 
 #%flag
+#% key: h
+#% description: Print history information in human readable shell style
+#%end
+
+#%flag
 #% key: s
 #% description: Print information about the temporal DBMI interface and exit
 #% suppress_required: yes
@@ -59,6 +64,7 @@
     type = options["type"]
     shellstyle = flags['g']
     system = flags['s']
+    history = flags['h']
 
     # Make sure the temporal database exists
     tgis.init()
@@ -97,6 +103,10 @@
 
     ds.select()
 
+    if history == True:
+        ds.print_history()
+        return
+
     if shellstyle == True:
         ds.print_shell_info()
     else:

Modified: grass/trunk/temporal/t.merge/t.merge.html
===================================================================
--- grass/trunk/temporal/t.merge/t.merge.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.merge/t.merge.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -7,7 +7,8 @@
 Existing space time datasets located in the current mapset can be specified as output as well. The
 maps from the input space time datasets will be added to the output.
 <p>
-Maps from the input space time datasets will be registered only once in the output space time dataset, hence the same maps can be registered in different input space time datasets.
+Maps from the input space time datasets will be registered only once in the 
+output space time dataset, hence the same maps can be registered in different input space time datasets.
 
 <h2>SEE ALSO</h2>
 

Modified: grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.html
===================================================================
--- grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -4,9 +4,9 @@
 This module support <em>absolute</em> and <em>relative time</em>.
 The temporal granularity of absolute time can be 
 <em>seconds, minutes, hours, days, weeks, months</em> or <em>years</em>.
-Mixing of granularities is not supported. 
-In case of relative time the temporal unit of the input space time raster dataset is used. The granularity
-must be specified with an integer value. 
+Mixing of granularities eg. "1 year, 3 months 5 days" is not supported. 
+In case of relative time the temporal unit of the input space time raster 
+dataset is used. The granularity must be specified with an integer value. 
 <p>
 This module is sensitive to the current region and mask settings, hence spatial extent and spatial resolution. 
 In case the registered raster maps of the input space time raster dataset
@@ -63,6 +63,45 @@
 
 t.info type=strds input=precipitation_daily
 
+ +-------------------- Absolute time -----------------------------------------+
+ | Start time:................. 2012-09-03 00:00:00
+ | End time:................... 2012-09-10 00:00:00
+ | Granularity:................ 1 day
+ | Temporal type of maps:...... interval
+ +-------------------- Spatial extent ----------------------------------------+
+ | North:...................... 80.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
+ | Top:........................ 0.0
+ | Bottom:..................... 0.0
+ +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_daily_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 1.0
+ | Minimum value max:.......... 1.0
+ | Maximum value min:.......... 1.0
+ | Maximum value max:.......... 1.0
+ | Number of registered maps:.. 7
+ |
+ | Title:
+ | Daily precipitation
+ | Description:
+ | Test dataset with daily precipitation
+ | Command history:
+ | # 2013-07-13 13:10:46 
+ | t.create type="strds" temporaltype="absolute"
+ |     output="precipitation_daily" title="Daily precipitation"
+ |     description="Test dataset with daily precipitation"
+ | # 2013-07-13 13:10:47 
+ | t.register -i type="rast" input="precipitation_daily"
+ |     file="map_list.txt" start="2012-08-20" increment="1 days"
+ | 
+ +----------------------------------------------------------------------------+
+
 t.rast.aggregate input=precipitation_daily \
                  output=precipitation_weekly \
                  base=prec_weekly granularity="1 weeks" \
@@ -73,9 +112,58 @@
           description="Aggregated precipitation dataset with weekly resolution"
                  
 t.info type=strds input=precipitation_weekly
+
+ +-------------------- Space Time Raster Dataset -----------------------------+
+ |                                                                            |
+ +-------------------- Basic information -------------------------------------+
+ | Id: ........................ precipitation_weekly at test
+ | Name: ...................... precipitation_weekly
+ | Mapset: .................... test
+ | Creator: ................... soeren
+ | Creation time: ............. 2013-07-13 13:11:23.286982
+ | Temporal type: ............. absolute
+ | Semantic type:.............. mean
+ +-------------------- Absolute time -----------------------------------------+
+ | Start time:................. 2012-09-03 00:00:00
+ | End time:................... 2012-09-10 00:00:00
+ | Granularity:................ 7 days
+ | Temporal type of maps:...... interval
+ +-------------------- Spatial extent ----------------------------------------+
+ | North:...................... 80.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
+ | Top:........................ 0.0
+ | Bottom:..................... 0.0
+ +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_weekly_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 7.0
+ | Minimum value max:.......... 7.0
+ | Maximum value min:.......... 7.0
+ | Maximum value max:.......... 7.0
+ | Number of registered maps:.. 1
+ |
+ | Title:
+ | Weekly precipitation
+ | Description:
+ | Aggregated precipitation dataset with weekly resolution
+ | Command history:
+ | # 2013-07-13 13:11:23 
+ | t.rast.aggregate input="precipitation_daily"
+ |     output="precipitation_weekly" base="prec_weekly" granularity="1 weeks"
+ |     method="sum" sampling="during"
+ | # 2013-07-13 13:11:29 
+ | t.support input="precipitation_weekly"
+ |     title="Weekly precipitation"
+ |     description="Aggregated precipitation dataset with weekly resolution"
+ | 
+ +----------------------------------------------------------------------------+
 </pre></div>
 
-
 <h2>SEE ALSO</h2>
 
 <em>
@@ -87,7 +175,6 @@
 <a href="r.mask.html">r.mask</a><br>
 </em>
 
-
 <h2>AUTHOR</h2>
 
 Sören Gebbert

Modified: grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html
===================================================================
--- grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -1,10 +1,233 @@
 <h2>DESCRIPTION</h2>
 
-TBD.
+This module works like <a href="t.rast.aggregate.html">t.rast.aggregate</a> but instead
+of defining a fixed granularity for temporal aggregation the time intervals of
+all maps registered in a second space time dataset (can be STRDS, STR3DS or STVDS)
+are used to aggregate the maps of the input space time raster dataset.
 
+<h2>EXAMPLE</h2>
+
+In this example we create 7 raster maps that will be registered in a single space time
+raster dataset named <em>precipitation_daily</em> using a daily temporal granularity.
+The names of the raster maps are stored in a text file that is used for raster map registration.
+<p>
+A space time vector dataset is created out of two vector maps with different
+temporal resolution. The maps are created using v.random. 
+The first map has a granule of 3 days the second a granule of 4 days.  
+<p>
+The space time raster dataset <em>precipitation_daily</em> with daily temporal granularity 
+will be aggregated using the space time vector dataset 
+resulting in the output space time raster dataset
+<em>precipitation_agg</em>. The aggregation method is set to <em>sum</em> to accumulate the precipitation values
+of all intervals in the space time vector dataset. The sampling option assures that only raster maps that are 
+temporally during the time intervals of the space time vector dataset are
+considered for computation: 
+
+<div class="code"><pre>
+
+MAPS="map_1 map_2 map_3 map_4 map_5 map_6 map_7"
+
+for map in ${MAPS} ; do
+    r.mapcalc --o expr="${map} = 1" 
+    echo ${map} >> map_list.txt 
+done
+
+t.create type=strds temporaltype=absolute \
+         output=precipitation_daily \
+         title="Daily precipitation" \
+         description="Test dataset with daily precipitation"
+
+t.register -i type=rast input=precipitation_daily \
+           file=map_list.txt start="2012-08-20" increment="1 days"
+
+t.info type=strds input=precipitation_daily
+
+ +-------------------- Space Time Raster Dataset -----------------------------+
+ |                                                                            |
+ +-------------------- Basic information -------------------------------------+
+ | Id: ........................ precipitation_daily at test
+ | Name: ...................... precipitation_daily
+ | Mapset: .................... test
+ | Creator: ................... soeren
+ | Creation time: ............. 2013-07-13 14:08:32.607419
+ | Temporal type: ............. absolute
+ | Semantic type:.............. mean
+ +-------------------- Absolute time -----------------------------------------+
+ | Start time:................. 2012-08-20 00:00:00
+ | End time:................... 2012-08-27 00:00:00
+ | Granularity:................ 1 day
+ | Temporal type of maps:...... interval
+ +-------------------- Spatial extent ----------------------------------------+
+ | North:...................... 80.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
+ | Top:........................ 0.0
+ | Bottom:..................... 0.0
+ +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_daily_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 1.0
+ | Minimum value max:.......... 1.0
+ | Maximum value min:.......... 1.0
+ | Maximum value max:.......... 1.0
+ | Number of registered maps:.. 7
+ |
+ | Title:
+ | Daily precipitation
+ | Description:
+ | Test dataset with daily precipitation
+ | Command history:
+ | # 2013-07-13 14:08:32 
+ | t.create type="strds" temporaltype="absolute"
+ |     output="precipitation_daily" title="Daily precipitation"
+ |     description="Test dataset with daily precipitation"
+ | # 2013-07-13 14:08:33 
+ | t.register -i type="rast" input="precipitation_daily"
+ |     file="map_list.txt" start="2012-08-20" increment="1 days"
+ | 
+ +----------------------------------------------------------------------------+
+
+v.random output=points_1 n=20
+v.random output=points_2 n=20
+
+t.create type=stvds temporaltype=absolute \
+         output=points \
+         title="Points" \
+         description="Points for aggregation"
+
+t.register -i type=vect input=points \
+           map=points_1 start="2012-08-20" increment="3 days"
+t.register -i type=vect input=points \
+           map=points_2 start="2012-08-23" increment="4 days"
+
+t.info type=stvds input=points
+
+ +-------------------- Space Time Vector Dataset -----------------------------+
+ |                                                                            |
+ +-------------------- Basic information -------------------------------------+
+ | Id: ........................ points at test
+ | Name: ...................... points
+ | Mapset: .................... test
+ | Creator: ................... soeren
+ | Creation time: ............. 2013-07-13 14:09:03.024090
+ | Temporal type: ............. absolute
+ | Semantic type:.............. mean
+ +-------------------- Absolute time -----------------------------------------+
+ | Start time:................. 2012-08-20 00:00:00
+ | End time:................... 2012-08-27 00:00:00
+ | Granularity:................ 1 day
+ | Temporal type of maps:...... interval
+ +-------------------- Spatial extent ----------------------------------------+
+ | North:...................... 73.65504
+ | South:...................... 4.601117
+ | East:.. .................... 118.150138
+ | West:....................... -39.987854
+ | Top:........................ 0.0
+ | Bottom:..................... 0.0
+ +-------------------- Metadata information ----------------------------------+
+ | Vector register table:...... points_test_vector_register
+ | Number of points ........... 40
+ | Number of lines ............ 0
+ | Number of boundaries ....... 0
+ | Number of centroids ........ 0
+ | Number of faces ............ 0
+ | Number of kernels .......... 0
+ | Number of primitives ....... 40
+ | Number of nodes ............ 0
+ | Number of areas ............ 0
+ | Number of islands .......... 0
+ | Number of holes ............ 0
+ | Number of volumes .......... 0
+ | Number of registered maps:.. 2
+ |
+ | Title:
+ | Points
+ | Description:
+ | Points for aggregation
+ | Command history:
+ | # 2013-07-13 14:09:03 
+ | t.create type="stvds" temporaltype="absolute"
+ |     output="points" title="Points" description="Points for aggregation"
+ | # 2013-07-13 14:09:12 
+ | t.register -i type="vect" input="points"
+ |     map="points_1" start="2012-08-20" increment="3 days"
+ | # 2013-07-13 14:09:13 
+ | t.register -i type="vect" input="points"
+ |     map="points_2" start="2012-08-23" increment="4 days"
+ | 
+ +----------------------------------------------------------------------------+
+
+t.rast.aggregate.ds input=precipitation_daily \
+                    output=precipitation_agg \
+                    sample=points type=stvds \
+                    base=prec_agg \
+                    method=sum sampling=during
+
+t.support input=precipitation_agg \
+          title="Aggregated precipitation" \
+          description="Aggregated precipitation dataset"
+                 
+t.info type=strds input=precipitation_agg
+
+ +-------------------- Space Time Raster Dataset -----------------------------+
+ |                                                                            |
+ +-------------------- Basic information -------------------------------------+
+ | Id: ........................ precipitation_agg at test
+ | Name: ...................... precipitation_agg
+ | Mapset: .................... test
+ | Creator: ................... soeren
+ | Creation time: ............. 2013-07-13 14:12:02.489102
+ | Temporal type: ............. absolute
+ | Semantic type:.............. mean
+ +-------------------- Absolute time -----------------------------------------+
+ | Start time:................. 2012-08-20 00:00:00
+ | End time:................... 2012-08-27 00:00:00
+ | Granularity:................ 1 day
+ | Temporal type of maps:...... interval
+ +-------------------- Spatial extent ----------------------------------------+
+ | North:...................... 80.0
+ | South:...................... -1.0
+ | East:.. .................... 120.5
+ | West:....................... -40.5
+ | Top:........................ 0.0
+ | Bottom:..................... 0.0
+ +-------------------- Metadata information ----------------------------------+
+ | Raster register table:...... precipitation_agg_test_raster_register
+ | North-South resolution min:. 1.0
+ | North-South resolution max:. 1.0
+ | East-west resolution min:... 1.0
+ | East-west resolution max:... 1.0
+ | Minimum value min:.......... 3.0
+ | Minimum value max:.......... 4.0
+ | Maximum value min:.......... 3.0
+ | Maximum value max:.......... 4.0
+ | Number of registered maps:.. 2
+ |
+ | Title:
+ | Aggregated precipitation
+ | Description:
+ | Aggregated precipitation dataset
+ | Command history:
+ | # 2013-07-13 14:12:02 
+ | t.rast.aggregate.ds input="precipitation_daily"
+ |     output="precipitation_agg" sample="points" type="stvds" base="prec_agg"
+ |     method="sum" sampling="during"
+ | # 2013-07-13 14:12:09 
+ | t.support input="precipitation_agg"
+ |     title="Aggregated precipitation"
+ |     description="Aggregated precipitation dataset"
+ | 
+ +----------------------------------------------------------------------------+
+</pre></div>
+
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="t.rast.aggregate.html">t.rast.aggregate</a>,
 <a href="t.create.html">t.create</a>,
 <a href="t.info.html">t.info</a>
 </em>

Modified: grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -5,7 +5,7 @@
 # MODULE:	t.rast.aggregate.ds
 # AUTHOR(S):	Soeren Gebbert
 #
-# PURPOSE:	Aggregated data of an existing space time raster dataset using the temporal topology of a second space time dataset
+# PURPOSE:	Aggregated data of an existing space time raster dataset using the time intervals of a second space time dataset
 # COPYRIGHT:	(C) 2011 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
@@ -15,7 +15,7 @@
 #############################################################################
 
 #%module
-#% description: Aggregated data of an existing space time raster dataset using the temporal topology of a second space time dataset.
+#% description: Aggregated data of an existing space time raster dataset using the time intervals of a second space time dataset.
 #% keywords: temporal
 #% keywords: aggregation
 #%end

Modified: grass/trunk/temporal/t.rast.export/t.rast.export.html
===================================================================
--- grass/trunk/temporal/t.rast.export/t.rast.export.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.export/t.rast.export.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -1,10 +1,118 @@
 <h2>DESCRIPTION</h2>
 
-TBD.
+This module exports a space time raster dataset as a tar archive. The archive contains the
+raster maps either as geotiff files or as GRASS binary files exported using r.out.bin.
+The map specific color tables are exported as well in case of geotiff files.
+In addition several meta data files are created in the archive that describe the 
+temporal layout. All time stamps are stored in the file "list.txt", for each map one row.
+The name of the map, the start time and the end time are written. In case of a time instance, 
+the start time is equal to the end time. The "init.txt" files stores the temporal
+type, the number of maps, the chosen export format and some other metadata. The "proj.txt"
+files stores the projection information as proj4 string of the 
+location the space time raster dataset was exported from.
+The file "readme.txt" describes the file format. The output of r.info is stored in "metadata.txt".
+<p>
+The tar archive can be compressed using the <b>compress</b> option. Gzip and bzip2 are
+available. A <b>where</b> option can be specified, to export only a subset of the space time dataset.
+Archives exported with <b>t.rast.export</b> can be importet with <b>t.rast.import</b>.
 
+<h2>EXAMPLE</h2>
+
+In this example we create 7 raster maps that will be registered in a single space time
+raster dataset named <em>precipitation_daily</em> using a daily temporal granularity.
+The names of the raster maps are stored in a text file that is used for raster map registration.
+We export the created space time raster dataset and will have a look at some files that are created: 
+
+<div class="code"><pre>
+
+MAPS="map_1 map_2 map_3 map_4 map_5 map_6 map_7"
+
+for map in ${MAPS} ; do
+    r.mapcalc --o expr="${map} = 1" 
+    echo ${map} >> map_list.txt 
+done
+
+t.create type=strds temporaltype=absolute \
+         output=precipitation_daily \
+         title="Daily precipitation" \
+         description="Test dataset with daily precipitation"
+
+t.register -i type=rast input=precipitation_daily \
+           file=map_list.txt start="2012-08-20" increment="1 days"
+
+t.rast.export input=precipitation_daily output=precipitation_daily.tar
+
+tar xvf precipitation_daily.tar
+map_1.tif
+map_1.color
+map_2.tif
+map_2.color
+map_3.tif
+map_3.color
+map_4.tif
+map_4.color
+map_5.tif
+map_5.color
+map_6.tif
+map_6.color
+map_7.tif
+map_7.color
+list.txt
+proj.txt
+init.txt
+readme.txt
+metadata.txt
+
+
+cat init.txt
+stds_type=strds
+format=GTiff
+temporal_type=absolute
+semantic_type=mean
+number_of_maps=7
+north=80.0
+south=0.0
+east=120.0
+west=0.0
+
+
+cat proj.txt
++proj=longlat
++no_defs
++a=6378137
++rf=298.257223563
++towgs84=0,0,0,0,0,0,0
+
+
+cat list.txt
+map_1|2012-08-20 00:00:00|2012-08-21 00:00:00
+map_2|2012-08-21 00:00:00|2012-08-22 00:00:00
+map_3|2012-08-22 00:00:00|2012-08-23 00:00:00
+map_4|2012-08-23 00:00:00|2012-08-24 00:00:00
+map_5|2012-08-24 00:00:00|2012-08-25 00:00:00
+map_6|2012-08-25 00:00:00|2012-08-26 00:00:00
+map_7|2012-08-26 00:00:00|2012-08-27 00:00:00
+
+
+cat readme.txt 
+This space time raster dataset was exported with t.rast.export of GRASS GIS 7
+
+Files:
+       *.tif  -- GeoTIFF raster files
+     *.color  -- GRASS GIS raster color rules
+     proj.txt -- Projection information in PROJ.4 format
+     init.txt -- GRASS GIS space time raster dataset information
+     list.txt -- Time series file, lists all maps by name with interval
+                 time stamps in ISO-Format. Field separator is |
+ metadata.txt -- The output of t.info
+   readme.txt -- This file
+
+</div>
+
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="t.rast.import.html">t.rast.import</a>,
 <a href="t.create.html">t.create</a>,
 <a href="t.info.html">t.info</a>
 </em>

Modified: grass/trunk/temporal/t.rast.extract/t.rast.extract.html
===================================================================
--- grass/trunk/temporal/t.rast.extract/t.rast.extract.html	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.extract/t.rast.extract.html	2013-07-13 17:53:36 UTC (rev 57095)
@@ -1,7 +1,80 @@
 <h2>DESCRIPTION</h2>
 
-TBD.
+The purpose of <b>t.rast.extract</b> is to extract a subset of a space time 
+raster dataset and to store that subset in a different space time raster dataset.
+The <b>where</b> condition is used to select the subset. In addition a r.mapcalc
+sub-expression can be specified that performs operations on all maps of the selected subset.
+In this expression the name of the input space time raster dataset can be used
+as simple map name. Other STRDS than the input STRDS can not be specified, but
+any raster map. In case a r.mapcalc sub-expression is defined, the base name 
+of the resulting raster maps must be specified. The r.mapcalc expression can be
+used to select maps as well, since by default resulting empty maps are not registered
+in the output space time raster dataset and removed after processing. The number of 
+parallel grass processes can be specified to speed up the processing.
+<p>
+If no r.mapcalc expression is defined, the selected maps are simply registered in
+the new created output space time raster dataset to avoid data duplication.
 
+<h2>Note</h2>
+
+The r.mapcalc sub-expression should not contain the left side "map =" of 
+a full r.mapcalc expression, only the right side, eg.: 
+
+
+<div class="code"><pre>
+t.rast.extract input=precipitation where="start_time > '2001-01-05'" \
+               output=selected_precipitation base=new_prec_map \
+               expression="if(precipitation < 5, null(), precipitation)"
+</div>
+
+<h2>EXAMPLE</h2>
+
+In this example we create 8 raster maps that will be registered in a single space time
+raster dataset named <em>precipitation_yearly</em> using a yearly temporal granularity.
+The names of the raster maps are stored in a text file that is used for raster map registration.
+<p>
+Then we extract all maps that are later 2005 and store the selected maps in
+the space time raster dataset <em>precipitation_yearly_later_2005</em>.
+<p>
+
+<div class="code"><pre>
+
+MAPS="map_1 map_2 map_3 map_4 map_5 map_6 map_7 map_8"
+
+for map in ${MAPS} ; do
+    r.mapcalc --o expr="${map} = 1" 
+    echo ${map} >> map_list.txt 
+done
+
+t.create type=strds temporaltype=absolute \
+         output=precipitation_yearly \
+         title="Yearly precipitation" \
+         description="Test dataset with yearly precipitation"
+
+t.register -i type=rast input=precipitation_yearly \
+           file=map_list.txt start="2000-01-01" increment="1 year"
+
+t.rast.list precipitation_yearly
+
+map_1   test    2000-01-01 00:00:00 2001-01-01 00:00:00
+map_2   test    2001-01-01 00:00:00 2002-01-01 00:00:00
+map_3   test    2002-01-01 00:00:00 2003-01-01 00:00:00
+map_4   test    2003-01-01 00:00:00 2004-01-01 00:00:00
+map_5   test    2004-01-01 00:00:00 2005-01-01 00:00:00
+map_6   test    2005-01-01 00:00:00 2006-01-01 00:00:00
+map_7   test    2006-01-01 00:00:00 2007-01-01 00:00:00
+map_8   test    2007-01-01 00:00:00 2008-01-01 00:00:00
+
+t.rast.extract input=precipitation_yearly output=precipitation_yearly_later_2005 \
+               where="start_time >= '2005-01-01'"
+
+t.rast.list precipitation_yearly_later_2005
+
+map_6   test    2005-01-01 00:00:00 2006-01-01 00:00:00
+map_7   test    2006-01-01 00:00:00 2007-01-01 00:00:00
+map_8   test    2007-01-01 00:00:00 2008-01-01 00:00:00
+</pre></div>
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
===================================================================
--- grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py	2013-07-13 17:53:36 UTC (rev 57095)
@@ -96,7 +96,6 @@
         if _map.get_id() is None:
             count += 1
             _id = "%s_%d@%s" % (base, num + count, mapset)
-            print _id
             _map.set_id(_id)
             if _map.map_exists() or _map.is_in_db(dbif):
                 grass.fatal(_("Map with name <%s> already exists. "

Modified: grass/trunk/temporal/t.vect.list/test.t.vect.list.sh
===================================================================
--- grass/trunk/temporal/t.vect.list/test.t.vect.list.sh	2013-07-13 17:35:13 UTC (rev 57094)
+++ grass/trunk/temporal/t.vect.list/test.t.vect.list.sh	2013-07-13 17:53:36 UTC (rev 57095)
@@ -102,6 +102,6 @@
 t.vect.list -h separator=" | " method=delta     input=lidar_abs5
 t.vect.list -h separator=" | " method=deltagaps input=lidar_abs5
 
-t.unregister type=vect maps=lidar_1,lidar_2,lidar_3,lidar_4,lidar_5,lidar_6
-t.remove type=stvds input=lidar_abs1,lidar_abs2,lidar_abs3,lidar_abs4,lidar_abs5
-g.remove vect=lidar_1,lidar_2,lidar_3,lidar_4,lidar_5,lidar_6
+#t.unregister type=vect maps=lidar_1,lidar_2,lidar_3,lidar_4,lidar_5,lidar_6
+#t.remove type=stvds input=lidar_abs1,lidar_abs2,lidar_abs3,lidar_abs4,lidar_abs5
+#g.remove vect=lidar_1,lidar_2,lidar_3,lidar_4,lidar_5,lidar_6



More information about the grass-commit mailing list