[GRASS-SVN] r64650 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 16 06:40:29 PST 2015


Author: huhabla
Date: 2015-02-16 06:40:29 -0800 (Mon, 16 Feb 2015)
New Revision: 64650

Modified:
   grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
Log:
temporal framework: One additional maplist granularity sampling test


Modified: grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
===================================================================
--- grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2015-02-16 13:36:51 UTC (rev 64649)
+++ grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2015-02-16 14:40:29 UTC (rev 64650)
@@ -1185,6 +1185,32 @@
                 None (12, 14)
                 None (14, 16)
 
+                >>> maps = []
+                >>> map1 = tgis.RasterDataset("map1 at PERMANENT")
+                >>> check = map1.set_absolute_time(datetime(2000, 4,1), datetime(2000, 6, 1))
+                >>> maps.append(map1)
+                >>> map2 = tgis.RasterDataset("map2 at PERMANENT")
+                >>> check = map2.set_absolute_time(datetime(2000, 8,1), datetime(2000, 12, 1))
+                >>> maps.append(map2)
+                >>> grans = tgis.AbstractSpaceTimeDataset.resample_maplist_by_granularity(maps,datetime(2000,1,1),datetime(2001,4,1),"1 month")
+                >>> for map_list in grans:
+                ...    print map_list[0].get_id(), map_list[0].get_temporal_extent_as_tuple()
+                None (datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 2, 1, 0, 0))
+                None (datetime.datetime(2000, 2, 1, 0, 0), datetime.datetime(2000, 3, 1, 0, 0))
+                None (datetime.datetime(2000, 3, 1, 0, 0), datetime.datetime(2000, 4, 1, 0, 0))
+                map1 at PERMANENT (datetime.datetime(2000, 4, 1, 0, 0), datetime.datetime(2000, 5, 1, 0, 0))
+                map1 at PERMANENT (datetime.datetime(2000, 5, 1, 0, 0), datetime.datetime(2000, 6, 1, 0, 0))
+                None (datetime.datetime(2000, 6, 1, 0, 0), datetime.datetime(2000, 7, 1, 0, 0))
+                None (datetime.datetime(2000, 7, 1, 0, 0), datetime.datetime(2000, 8, 1, 0, 0))
+                map2 at PERMANENT (datetime.datetime(2000, 8, 1, 0, 0), datetime.datetime(2000, 9, 1, 0, 0))
+                map2 at PERMANENT (datetime.datetime(2000, 9, 1, 0, 0), datetime.datetime(2000, 10, 1, 0, 0))
+                map2 at PERMANENT (datetime.datetime(2000, 10, 1, 0, 0), datetime.datetime(2000, 11, 1, 0, 0))
+                map2 at PERMANENT (datetime.datetime(2000, 11, 1, 0, 0), datetime.datetime(2000, 12, 1, 0, 0))
+                None (datetime.datetime(2000, 12, 1, 0, 0), datetime.datetime(2001, 1, 1, 0, 0))
+                None (datetime.datetime(2001, 1, 1, 0, 0), datetime.datetime(2001, 2, 1, 0, 0))
+                None (datetime.datetime(2001, 2, 1, 0, 0), datetime.datetime(2001, 3, 1, 0, 0))
+                None (datetime.datetime(2001, 3, 1, 0, 0), datetime.datetime(2001, 4, 1, 0, 0))
+
         """
 
         if not maps:



More information about the grass-commit mailing list