[GRASS-SVN] r59015 - grass-addons/grass7/raster/r.shalstab
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 13 01:31:29 PST 2014
Author: kikapu
Date: 2014-02-13 01:31:28 -0800 (Thu, 13 Feb 2014)
New Revision: 59015
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 09:13:28 UTC (rev 59014)
+++ grass-addons/grass7/raster/r.shalstab/r.shalstab.py 2014-02-13 09:31:28 UTC (rev 59015)
@@ -154,7 +154,7 @@
k = k,
z = z)
# calculate dimensionless
- grass.mapcalc("C=($root+$c_soil)/($z*cos(slopes)*9.81*$gamma_wet)",
+ grass.mapcalc("C=($root+$c_soil)/($z*cos(slopes)*9.81*$gamma)",
root = root,
c_soil = c_soil,
z = z,
@@ -178,7 +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_mm=i_crit_m*1000")
+ 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')
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)
@@ -201,6 +203,7 @@
grass.run_command('g.remove', rast=("A",
"copia_reclass",
"i_crit_m",
+ "i_cri_m_1000",
"i_recl",
"accum",
"slopes",
More information about the grass-commit
mailing list