Skip to content
Snippets Groups Projects
Commit 5f8d1b46 authored by (no author)'s avatar (no author)
Browse files

correcting stats call to not attempt analysis if the entire data set is masked out

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@65 8a9318a1-56ba-4d59-b755-99d26321be01
parent 36d70fc2
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,13 @@ def rms_corr_withnoise(truth, actual, noiz, epsilon=0., (amissing,bmissing)=(Non
}
def stats(diffData, mask, *etc):
# if there are no values after the mask,
# we can't do any of these forms of
# statistical analysis
if sum(mask) is 0 :
return { }
absDiffData = abs(diffData)
rms = sqrt( sum(diffData[mask] ** 2) / sum(mask) )
return { 'rms_diff': rms,
......@@ -281,7 +288,7 @@ def _get_numerical_data_stats(a, b, diff_data, data_is_finite_mask, outside_epsi
# get the min, ignoring the stuff in mask
def min_with_mask(data, mask) :
temp = data[~mask]
toReturn = nan
toReturn = None
if len(temp) > 0 :
toReturn = temp[temp.argmin()]
return toReturn
......@@ -289,7 +296,7 @@ def min_with_mask(data, mask) :
# get the max, ignoring the stuff in mask
def max_with_mask(data, mask) :
temp = data[~mask]
toReturn = nan
toReturn = None
if len(temp) > 0 :
toReturn = temp[temp.argmax()]
return toReturn
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment