r.mapcalc help needed

Ronald Thomas ront at niwot.CFNR.ColoState.EDU
Tue Mar 9 19:20:03 EST 1993


GRASSuser's,

I'm in need of assistance in formulating a "r.mapcalc" statement.
I am attemping to produce a transformed vegetation index by using the
square root of ratioed TM bands. I'm using the formula:

TV1="(sqrt((('band.2'-'band.1')/('band.2'+'band.1')) + 0.5)) *
100)"

and I keep getting a single value as output.  Does the fact that the maps
(band.x) are integers have something to do with it?  Are the internal
computations within the string truncated to integers as in standard map
arithmetic, or do they remain floating because they are part of the square
root function?   Am I correct in assuming that the maps within the internal
parentheses are being added or subtracted first, these sums divided, then 
added to the  "0.5" , and the square root of this sum finally being
multiplied by 100,  as I would approach it manually, or does r.mapcalc 
approach this differently?  If so, can someone shed some light on how to
turn standard math notation into "mapcalc-speak"?  

Or, do I have to do this in ERDAS, which handles floating point values?
 
 If r.mapcalc will allow the use of floating points within an expression, why
 doesn't it handle the ratio of integers as floating point values until
 writing out a map?  Am I confusing anyone yet?

Thanks for any help offered!


^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^
   Ronald Thomas                         ^  ront at meeker.cfnr.colostate.edu
    Natural Resources Spec. (GIS)        ^  
     Resources Management Division       ^   Phone: 303-586-3565  x285
      Rocky Mountain National Park       ^          700-323-7285  (FTS)
       Estes Park, CO  80517             ^ 
^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^


----- End Included Message -----




More information about the grass-user mailing list