[GRASS-SVN] r58351 - grass-addons/grass6/raster/r.maxent.lambdas

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 2 04:22:20 PST 2013


Author: sbl
Date: 2013-12-02 04:22:20 -0800 (Mon, 02 Dec 2013)
New Revision: 58351

Modified:
   grass-addons/grass6/raster/r.maxent.lambdas/r.maxent.lambdas
Log:
Fixes by Paulo van Breugel included

Modified: grass-addons/grass6/raster/r.maxent.lambdas/r.maxent.lambdas
===================================================================
--- grass-addons/grass6/raster/r.maxent.lambdas/r.maxent.lambdas	2013-12-02 05:33:23 UTC (rev 58350)
+++ grass-addons/grass6/raster/r.maxent.lambdas/r.maxent.lambdas	2013-12-02 12:22:20 UTC (rev 58351)
@@ -3,7 +3,10 @@
 ############################################################################ 
 # 
 # MODULE:       r.maxent.lambdas 
-# AUTHOR(S):    Stefan Blumentrath <stefan dot blumentrath at nina dot no > 
+# AUTHOR(S):    Stefan Blumentrath <stefan dot blumentrath at nina dot no >
+#               Proposed small change in how raw features are extracted 
+#               from the lambdas file as this didn't work in original
+#               code (Paulo van Breugel)
 # PURPOSE:      Compute raw and/or logistic prediction maps from a lambdas
 #               file produced with MaxEnt 3.3.3e. 
 #
@@ -189,7 +192,7 @@
 ###Create file with initial part of mapcalc-expression
 echo "${OUTPUT_PREFIX}_raw=exp(((\\" > "$temp1"
 ###Extract raw features
-cat -v "${LAMBDAS_FILE}" | awk '$0 !~ /\^2|\(|\*|\`/' | grep -vP "\'" | sed 's/\^M//g' | sed 's/,//g' | awk 'NF==4{print "if(isnull(" $1 "),0,(" $2 "*(" $1 "-" $3 ")/(" $4 "-" $3 ")))" "+" "\\"}' | sed 's/--/+/g' | sed 's/+-/-/g' >> $temp1
+cat -v "${LAMBDAS_FILE}" | awk '$0 !~ /\^|\(|\*/' | grep -vP "\`" | grep -vP "\'" | sed 's/\^M//g' | sed 's/,//g' | awk 'NF==4{print "if(isnull(" $1 "),0,(" $2 "*(" $1 "-" $3 ")/(" $4 "-" $3 ")))" "+" "\\"}' | sed 's/--/+/g' | sed 's/+-/-/g' >> $temp1
 ###Extract quadratic features
 cat -v "${LAMBDAS_FILE}" | grep '\^2' | sed 's/\^M//g' | sed 's/,//g' | sed 's/\^2//g' | awk '{print "if(isnull(" $1 "),0,((" $2 "*(" $1 "*" $1 "-" $3 "))/" "(" $4 "-" $3 ")))" "+" "\\"}' | sed 's/--/+/g' | sed 's/+-/-/g' >> $temp1
 ###Extract product features



More information about the grass-commit mailing list