I recently have had some problems with and NDVI calculation in which I am seeing min/max bounds from -inf/inf. I decided to try to diagnose the problem by using the "find" command to identify points in the array which are a problem. However, I found that "find" cloud not identify infinite values properly. When the product is displayed, values are listing as missing to missing (actually, I can reset the range to -1,1 and see an NDVI result, so the array is not full of missing or even infinite values). I tried the following tests to identify infinite values in an array with no success.
Code: Select all
import java.lang.Float
infinity=Float.POSITIVE_INFINITY
afield=field([infinity,infinity,1])
print afield
l= find(afield,'==',infinity)
print len(l)
# this fails to identify locations of infinite value as well (find nothing)
l=find(afield,'==', float('inf'))
print len(l)
# can't get the expected answer when looking for the opposite either (would expect an array with dimension of 1)
l=find(afield,'!=', infinity)
print l
Joleen