<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thank you so much, Markus!<br>
      <br>
      That was the missing hint and it works now! <br>
      However, I just went through the documentation, which says: "<em>F</em>
      means that the functions always results in a floating point value"
      and Function "log" has "F". <br>
      <br>
      This is somehow misleading and rather should be an "*". Can I
      correct that somewhere without access-rights (to contribute) or
      would I rather report this?<br>
      <br>
      <br>
      Patrick <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
       that On 11/08/2012 07:34 PM, Markus Metz wrote:<br>
    </div>
    <blockquote
cite="mid:CAG+h=FFRRMmZRsTrEY0vKGHqha0gVorZnf1c2y068dTf=R7ZpQ@mail.gmail.com"
      type="cite">
      <pre wrap="">On Thu, Nov 8, 2012 at 10:50 AM, Patrick S. <a class="moz-txt-link-rfc2396E" href="mailto:patrick_GIS@gmx.ch"><patrick_GIS@gmx.ch></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Dear List,

I keep getting a log(0) error in r.mapcalculator, even if I enlarge the
data. This seems to be a bug as I controlled the same data with R and get
(non-infinity) values. Does r.mapcalculator eventually truncate the results
of formulas to some integer values?

logit-expression:  log(((A/100)/(1-(A/100)))
</pre>
      </blockquote>
      <pre wrap="">
In r.mapcalc, the numbers are treated as integers. Try instead log(((A
/ 100.0) / (1.0 - (A / 100.0)))
Changing e.g. 1 to 1.0 forces r.mapcalc to do floating point calculations.

HTH,

Markus M


</pre>
      <blockquote type="cite">
        <pre wrap="">
To avoid error of log(0) I enlarged the data by 0.00001, 1 and 5 but keep
getting the error.

I run it out of R with:
param<-list(amap="r_slope_perc", formula="log(((A+0.00001)/100)/(1-(A/100)))
", outfile="r_slope_perc_logit")
execGRASS("r.mapcalculator", parameters=param, flags=c("overwrite"))

(r.mapcalculator amap="r_slope_perc",
formula="log(((A+0.00001)/100)/(1-(A/100)))" outfile="r_slope_perc_logit"
--overwrite)


Any ideas why this happens?

Patrick
_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
</pre>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>