[Scipy-svn] r2440 - trunk/Lib/sandbox/timeseries
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Dec 20 12:09:20 EST 2006
Author: mattknox_ca
Date: 2006-12-20 11:09:08 -0600 (Wed, 20 Dec 2006)
New Revision: 2440
Modified:
trunk/Lib/sandbox/timeseries/corelib.py
Log:
bug fixes and code cleanup
Modified: trunk/Lib/sandbox/timeseries/corelib.py
===================================================================
--- trunk/Lib/sandbox/timeseries/corelib.py 2006-12-20 00:32:18 UTC (rev 2439)
+++ trunk/Lib/sandbox/timeseries/corelib.py 2006-12-20 17:09:08 UTC (rev 2440)
@@ -83,17 +83,21 @@
def __unmasked(m, get_val, relpos):
- idx = numpy.where(m.mask == False)
- if len(idx) != 0 and len(idx[0]) != 0:
- idx = idx[0][relpos]
+
+ if m.mask is ma.nomask:
+ return 0
else:
- idx = None
-
- if get_val:
- if idx is None: return ma.masked
- else: return m[idx]
- else:
- return idx
+ idx = numpy.where(m.mask == False)
+ if len(idx) != 0 and len(idx[0]) != 0:
+ idx = idx[0][relpos]
+ else:
+ idx = None
+
+ if get_val:
+ if idx is None: return ma.masked
+ else: return m[idx]
+ else:
+ return idx
#############################################################
#converts possible strings for frequency into acceptable values
More information about the Scipy-svn
mailing list