From: <js...@us...> - 2008-12-31 20:19:20
|
Revision: 6729 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6729&view=rev Author: jswhit Date: 2008-12-31 20:19:16 +0000 (Wed, 31 Dec 2008) Log Message: ----------- fix small bug in land-sea mask lat/lon definitions 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-12-31 19:56:55 UTC (rev 6728) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-31 20:19:16 UTC (rev 6729) @@ -3110,9 +3110,16 @@ lsmaskf = open(os.path.join(basemap_datadir,'5minmask.bin'),'rb') nlons = 4320; nlats = nlons/2 delta = 360./float(nlons) - lsmask_lons = np.arange(-180+0.5*delta,180.,delta) - lsmask_lats = np.arange(-90.+0.5*delta,90.,delta) lsmask = np.reshape(np.fromstring(lsmaskf.read(),np.uint8),(nlats,nlons)) + lsmask_lons = np.arange(-180,180.,delta) + lsmask_lats = np.arange(-90.,90+0.5*delta,delta) + # add cyclic point in longitude + lsmask, lsmask_lons = addcyclic(lsmask, lsmask_lons) + nlons = nlons + 1; nlats = nlats + 1 + # add North Pole point (assumed water) + tmparr = np.zeros((nlats,nlons),lsmask.dtype) + tmparr[0:nlats-1,0:nlons] = lsmask + lsmask = tmparr lsmaskf.close() # instance variable lsmask is set on first invocation, # it contains the land-sea mask interpolated to the native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |