r.mapcalc problem

huddle at Picard.EOS.UoGuelph.Ca huddle at Picard.EOS.UoGuelph.Ca
Thu Oct 15 14:54:07 EDT 1992


Hi

I have been trying to use r.mapcalc to calculate a new layer based on several
other map layers. The following is the script for r.mapcalc

1000.2.lfc = eval( \
	b=(sin(1000.2.slp)/0.0896)/(3.0*exp(sin(1000.2.slp),0.8)+0.56),\
	mine = b/(1+b),\
	x = 1000.2.lng/22.13,\
	if(mine,exp(x,mine)))

when this script is run with r.mapcalc i get a POW domain error. After some
chasing after the error I seem to have tracked it to the exp expression in the
last line. If I replace the variable mine with a fixed value in the exp expression I nolong get the error.

The range of *.slp is 0-12 and *.lng is 0-900. x, therefore could be 0 and mine can be zero also, although the use of the if should limit the use of exp to +ve values of mine.

Any ideas on why this is working this way?

Thanks

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=**=*=*=*=*=*=*=*=*=*=*=*
Steve Huddle, Graduate Student
School of Engineering, University of Guelph, Guelph, ON, Canada, N1G 2W1
E-Mail InterNet: HUDDLE at Net2.EOS.UoGuelph.Ca
Telephone: (519) 824-4120 ext 4323                   FAX: (519) 836-0227




More information about the grass-user mailing list