comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » please help with ndvi calculation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
please help with ndvi calculation [message #52835] Thu, 01 March 2007 21:09
beardown911 is currently offline  beardown911
Messages: 21
Registered: March 2007
Junior Member
Hello all,

I am new in idl programming, and have been trying to figure out to
write a simple code to calculate ndvi.

Here is what I've done, but gave weird value.
------------------------------------------------------
pro ndvi
image = read_tiff ('/rsi/idl62/training/data/image.tif')
help, image

sub = float(image[0,*,*]-image[1,*,*])
sum = float(image[0,*,*]+image[1,*,*])

ndvi_image = sub / sum

write_tiff, '/rsi/idl62/training/data/ndvi_test.tif', ndvi_image
end
-------------------------------------------------------
The image.tif have three bands(nir, red, green) 8 bit image.
The resulting ndvi image is still integer and values are totally
wrong.
Could anybody help me to fix this?

Thank you,
Phil
[Message index]
 
Read Message
Previous Topic: How can I multi-plot in IDL with the coordinates set by myself?
Next Topic: Re: please help with ndvi calculation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:17:41 PDT 2025

Total time taken to generate the page: 0.63943 seconds