Select to view content in your preferred language

Raster Calculator - applying the following formulae for MODIS NDVI

1275
4
05-24-2010 01:15 AM
JonathanMcCloskey
Emerging Contributor
Hi,

I am trying use MODIS Surface Reflectance Bands 1 and 2 rasters to calculate my own daily NDVI products using the following formula

NDVI = (Raster 1 - Ratser 2)/(Raster 1 + Raster 2);

The pixel values should be in decimals but when I run through Raster Calculator I get whole numbers and everything is zero.  Does anyone know off a way to get the results in decimals?

Many thanks

Jon
0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus
did you copy and paste the equation from the raster calculator?  the first subtraction says Ratser 2
also, did you type in the equation or did you select rasters and the operands to form the expression?
0 Kudos
JonathanMcCloskey
Emerging Contributor
Dan,

Nope the equation was just typed in and is short names for the actual layers, everything i sselected from the layers.  The formulae works but I get the values in whole numbers ie -1, 0, 1 (this is the range of NDVI values) however I need to know the decimal figures to 2 decimals points. ie 0.23, 0.47.......... etc.

Raster calculator seems to automatically round the decimals to the nearest whole number which is casuing me the problem.

Many thanks

Jon
0 Kudos
JonathanMcCloskey
Emerging Contributor
sorted, just have to add float to the start of the equation

thanks
0 Kudos
Khairul_AzwanMohamad
New Contributor
0 Kudos