[GRASS-dev] Unexpected EVI range from "i.vi"

Nikos Alexandris nik at nikosalexandris.net
Wed Jun 12 15:36:15 PDT 2013


Nikos Alexandris wrote:
> > I get an unexpected range of evi values using "i.vi" (G7), i.e.

> > 	# derive EVI
> > 	i.vi viname=evi red=B.Trimmed.ToAR.3 blue=B.Trimmed.ToAR.1
> > 	nir=B.Trimmed.ToAR.4 output=evi

> > 	# range is...
> > 	r.info -r evi
	
> > 	min=-6912.82161611806
> > 	max=2264.42037461018
..
> Will check further - sorry for the noise.

Back to this post with one example (and, maybe I have to test this exact 
pixel/coordinates as in the other post the way Markus N suggested).


In the beginning

g.region rast=B.Trimmed.ToAR.1 -pa res=30 # wrongly map-calced the map to 15m, 
thus using res=


Next, calculating the evi for *simple* Top-of-Atmosphere values, that is 
"i.landsat.toar method=uncorrected"

	i.vi viname=evi blue=B.Trimmed.ToAR.1 red=B.Trimmed.ToAR.3 
nir=B.Trimmed.ToAR.4 output=evi_ToAR --o

gives for example

	r.info -r evi_ToAR
	min=-5905.44171917482
	max=6952.80543731566


Looking for these pixels, e.g.

	r.stats evi_ToAR -g | grep '\-5905'

	784935 2695215 -5905.4417191748
	786465 2694675 -5905.4417191748
	766185 2685615 -5905.4417191748

and

	r.stats evi_ToAR -g | grep '6952\.'

	783435 2690025 6952.8054373157


Then tracing the values that produced this out-of-range value,

	r.what coordinates=784935,2695215 
map=B.Trimmed.ToAR.1,B.Trimmed.ToAR.3,B.Trimmed.ToAR.4,evi_DN,evi_ToAR

	784935|2695215||0.230260364323039|0.110923862670943|0.0614305088322746|
0.35181236673774|-5905.44171917482

and

	r.what coordinates=783435,2690025 
map=B.Trimmed.ToAR.1,B.Trimmed.ToAR.3,B.Trimmed.ToAR.4,evi_DN,evi_ToAR

	783435|2690025||0.228143006540123|0.106632395012542|0.0712654621906476|
0.296610169491526|6952.80543731566


Doing the math in R is like

> blue <- 0.230260364323039
> red <- 0.110923862670943                                                                        
> nir <- 0.0614305088322746                                                                       
> evi <- ( 2.5 * ( nir - red) ) / (nir + 6 * red - 7 * blue + 1.0)
> evi
[1] -1.07453

and

> blue <- 0.228143006540123
> red <- 0.106632395012542                                                                        
> nir <- 0.0712654621906476                                                                       
> evi <- ( 2.5 * ( nir - red) ) / (nir + 6 * red - 7 * blue + 1.0)
> evi                                                                                             
[1] -0.7751909 

What am I doing wrong... ?  Any idea(s)?

More info

r.univar evi_ToAR
 100%

total null and non-null cells: 46883168
total null cells: 11617784

Of the non-null cells:
----------------------
n: 35265384
minimum: -5905.44
maximum: 6952.81
range: 12858.2
mean: -0.041618
mean of absolute values: 0.0923752
standard deviation: 2.31373
variance: 5.35336
variation coefficient: -5559.45 %
sum: -1467674.39355633

Nikos


More information about the grass-dev mailing list