[GRASS-user] pyhton script-how to get the pixel value from r.what

tigrida adriana.mata at ipicyt.edu.mx
Wed Mar 28 17:38:24 EDT 2012


Hello!

I am writing a python script, and I want to do mathematical operations with
some pixels, but I can't. Can anyone help me?


script:
ts_f= grass.read_command("r.what",input=Ts, east_north= "%s,%s" %
(eastF,northF))
print "Ts pixel frio=",ts_f
lambda_f=(2.501-(0.00236*(ts_f-273.15)))*1000000

error:
Ts pixel frio= 180740.539419|2399806.55602||290.266289112492

Traceback (most recent call last):
  File "vslp2.py", line 284, in <module>
    lambda_f=(2.501-(0.00236*(ts_f-273.15)))*1000000
TypeError: unsupported operand type(s) for -: 'str' and 'float'


I really appreciate any suggestions



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/pyhton-script-how-to-get-the-pixel-value-from-r-what-tp4665870p4665870.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list