[GRASS-SVN] r59019 - grass-addons/grass7/raster/r.shalstab

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 13 02:21:48 PST 2014


Author: kikapu
Date: 2014-02-13 02:21:48 -0800 (Thu, 13 Feb 2014)
New Revision: 59019

Modified:
   grass-addons/grass7/raster/r.shalstab/r.shalstab.py
Log:
R.shalstab: change critic rain classification

Modified: grass-addons/grass7/raster/r.shalstab/r.shalstab.py
===================================================================
--- grass-addons/grass7/raster/r.shalstab/r.shalstab.py	2014-02-13 10:14:27 UTC (rev 59018)
+++ grass-addons/grass7/raster/r.shalstab/r.shalstab.py	2014-02-13 10:21:48 UTC (rev 59019)
@@ -178,9 +178,9 @@
     grass.mapcalc("i_crit_m=(T*sin(slopes)*((ewres()+nsres())/2)/A*($gamma/1000*(1-(1-C/(sin(slopes)*cos(slopes))))*(tan(slopes)/tan($phy))))+(assoluta_cond)+(cond_instab)",
                   phy=phy, gamma=gamma)
     # Calculation of critical rain (mm / hr) and riclassification
-    grass.mapcalc("i_cri_m_1000=i_crit_m*1000")
-    grass.mapcalc("i_cri_mm=if(i_cri_m_1000>200, null(), i_cri_m_1000)")
-    grass.run_command('r.colors', map='i_cri_mm', color='precipitation')
+    grass.mapcalc("i_cri_mm=i_crit_m*1000")
+    grass.mapcalc("i_cri_mm_reclass=if(i_cri_mm>200, null(), i_cri_mm)")
+    grass.run_command('r.colors', map='i_cri_mm_reclass', color='precipitation')
     reclass_rules = "0 thru 30 = 2\n31 thru 100 = 3\n101 thru 150 = 4\n151 thru 200 = 5\n201 thru 999 = 6"
     grass.write_command('r.reclass', input='i_cri_mm', output='i_recl',
                         overwrite='True', rules='-', stdin=reclass_rules)
@@ -198,12 +198,12 @@
                       size=3, output='I_cri_average')
     # rename maps
     grass.run_command('g.rename', rast=("I_cri_average", susceptibility))
-    grass.run_command('g.rename', rast=("i_cri_mm", critic_rain))
+    grass.run_command('g.rename', rast=("i_cri_mm_reclass", critic_rain))
     # remove temporary map
     grass.run_command('g.remove', rast=("A", 
                                         "copia_reclass", 
                                         "i_crit_m",
-                                        "i_cri_m_1000",
+                                        "i_cri_mm",
                                         "i_recl", 
                                         "accum", 
                                         "slopes", 



More information about the grass-commit mailing list