If the index is "-1", IDL will return the last element in an array:
IDL> a = [2,3,4,5]
IDL> a[-1]
5
This is shorthand notation for SIZE-1, for example:
IDL> a[N_ELEMENTS(a)-1]
5
This is discussed on the following help page:
http://www.harrisgeospati...ubscript_Ranges.html My recommendation is to use the NULL keyword when calling the WHERE function. For example:
IDL> data=[1,2,3,4,5,6,7,8,9]
IDL> m=mean(data)
IDL> index=where(data gt 10, /NULL)
IDL> m=mean(data[index])
% TOTAL: Variable is undefined: X.
% Execution halted at: $MAIN$
IDL> data[index]
!NULL
-David
Harris GS