From: <js...@us...> - 2008-11-07 12:30:14
|
Revision: 6369 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6369&view=rev Author: jswhit Date: 2008-11-07 12:30:08 +0000 (Fri, 07 Nov 2008) Log Message: ----------- added masked array support to addcyclic function (thanks to Jesper Larsen) Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-11-06 22:53:02 UTC (rev 6368) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-11-07 12:30:08 UTC (rev 6369) @@ -3679,8 +3679,14 @@ if lon0 < lonsin[0] or lon0 > lonsin[-1]: raise ValueError, 'lon0 outside of range of lonsin' i0 = np.argmin(np.fabs(lonsin-lon0)) - dataout = np.zeros(datain.shape,datain.dtype) - lonsout = np.zeros(lonsin.shape,lonsin.dtype) + if hasattr(datain,'mask'): + datout = ma.zeros((nlats,nlons+1),datain.dtype) + else: + datout = np.zeros((nlats,nlons+1),datain.dtype) + if hasattr(lonsin,'mask'): + lonsout = ma.zeros(nlons+1,lonsin.dtype) + else: + lonsout = np.zeros(nlons+1,lonsin.dtype) if start: lonsout[0:len(lonsin)-i0] = lonsin[i0:] else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |