[GRASS-SVN] r50942 - grass-addons/grass6/raster/r.basin

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 25 15:10:32 EST 2012


Author: madi
Date: 2012-02-25 12:10:31 -0800 (Sat, 25 Feb 2012)
New Revision: 50942

Modified:
   grass-addons/grass6/raster/r.basin/r.basin.py
Log:
platform recognition

Modified: grass-addons/grass6/raster/r.basin/r.basin.py
===================================================================
--- grass-addons/grass6/raster/r.basin/r.basin.py	2012-02-25 13:38:13 UTC (rev 50941)
+++ grass-addons/grass6/raster/r.basin/r.basin.py	2012-02-25 20:10:31 UTC (rev 50942)
@@ -71,6 +71,7 @@
 from numpy import array
 from numpy import zeros
 import csv
+import platform
 
 if not os.environ.has_key("GISBASE"):
     grass.message( "You must be in GRASS GIS to run this program." )
@@ -118,6 +119,9 @@
     v_ord_1 = prefix+'_ord_1'
     global tmp
     
+    # get info about the platform
+    plat = platform.system()
+    
     # Save current region
     grass.read_command('g.region', flags = 'p', save = 'original', overwrite = True)
 
@@ -287,19 +291,31 @@
                                            flags = 'o', 
                                            distance = r_distance,
                                            overwrite = True)
+                                           
+        if plat == "Windows":
+            # Ipsographic curve
+            grass.message( "##################################" )
+            grass.run_command('r.ipso', map = 'r_elevation_crop', image = prefix, flags = 'ab') 
+            grass.message( "##################################" )  
+            # Width Function 
+            grass.message( "##################################" )
+            grass.run_command('r.wf', map = r_distance, 
+                                      image = prefix) 
+            grass.message( "##################################" )                     
+        
+        else:
+            # Ipsographic curve
+            grass.message( "##################################" )
+            grass.run_command('r.ipso.py', map = 'r_elevation_crop', 
+                                           image = prefix, 
+                                           flags = 'ab')
+            grass.message( "##################################" )
     
-        # Width Function
-        grass.message( "##################################" )
-        grass.run_command('r.wf.py', map = r_distance, 
-                                 image = prefix) 
-        grass.message( "##################################" )                         
-
-        # Ipsographic curve
-        grass.message( "##################################" )
-        grass.run_command('r.ipso.py', map = 'r_elevation_crop', 
-                                   image = prefix, 
-                                   flags = 'ab')
-        grass.message( "##################################" )
+            # Width Function
+            grass.message( "##################################" )
+            grass.run_command('r.wf.py', map = r_distance, 
+                                               image = prefix) 
+            grass.message( "##################################" )                         
     
         # Creation of map of hillslope distance to river network
         grass.run_command('r.stream.distance', stream = r_stream_e, 



More information about the grass-commit mailing list