Jeff,
Thanks for working on this, but it seems the problem is not solved. I retrieved basemap.py from CVS and reinstalled basemap. I then received the same error further down in drawparallels. So, I made the change manually (removed the ,'f') from the NX.ones call) and the error then popped up in drawmeridians. Next I did a global search/replace and it seems that was overkill. After removing all of the ,'f' from any numerix function I tried again and received the error below.
[snowden@...949... examples]$ python nytolondon.py
warning: figure.subplot.left rc value being reset to 0.1 in basemap
use rcdefaults() to get the original value back
Traceback (most recent call last):
File "nytolondon.py", line 28, in ?
m.drawparallels(circles,labels=[1,1,0,1])
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 1319, in drawparallels
x,y = self(lons,lats)
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 931, in __call__
return self.projtran(x,y,inverse=inverse)
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/proj.py", line 167, in __call__
outx,outy = self._proj4(x,y)
File "proj4.pyx", line 330, in proj4.Proj.__call__
File "proj4.pyx", line 152, in proj4.Proj._fwd
RuntimeError: Buffer lengths not the same
It seems what I did was overkill. I am using numpy. When I switch to Numeric using my altered version of basemap.py, I am able to run nytolondon.py and ireland.py but most of the other examples fail with some variation of the following exception
Traceback (most recent call last):
File "plotmap.py", line 26, in ?
topodat,x,y = m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True)
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 1700, in transform_scalar
datout = interp(datin,lons,lats,lonsout,latsout,checkbounds=checkbounds,order=order)
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 2259, in interp
dataout = NX.reshape(dataout,xout.shape)
ValueError: total size of new array must be unchanged
Next I retrieved the basemap.py from cvs again and reinstalled it. The following scripts work when using Numeric,
fillstates.py
ireland.py
hurrtracks.py
nytolondon.py
and the following do not,
plotmap*.py
simpletest*.py
contour_demo.py
ortho_demo.py
randompoints.py
quiver_demo.py
test.py
wiki_example.py
I did not try fcstmaps.py and testgdal.py since I don't have the dependencies installed yet.
Hope that helps!
Derrick
Jeff Whitaker wrote:
···
Derrick Snowden wrote:
Hi
I'm trying to test a new installation of matplotlib (0.86) and Basemap (0.7.2). On most of the examples I get the following error which seems to be related to proj4 libraries...
> python nytolondon.py
warning: figure.subplot.left rc value being reset to 0.1 in basemap
use rcdefaults() to get the original value back
Traceback (most recent call last):
File "nytolondon.py", line 9, in ?
lat_0=40.,lon_0=-20.,lat_ts=20.)
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 477, in __init__
xc,yc = proj(NX.array(cntrylons,'f'),NX.array(cntrylats))
File "/usr/lib64/python2.4/site-packages/matplotlib/toolkits/basemap/proj.py", line 167, in __call__
outx,outy = self._proj4(x,y)
File "proj4.pyx", line 330, in proj4.Proj.__call__
File "proj4.pyx", line 152, in proj4.Proj._fwd
RuntimeError: Buffer lengths not the same
I'm not sure how to proceed with this. Has anyone seen anything similar? I should mention that this is a linux x86_64 machine running Fedora Core 4.
Thanks
Derrick
Derrick: If you are using the new scipy-core/numpy, you'll need cvs basemap (until I make a new release).
-Jeff
--
Derrick Snowden
PhOD/AOML/NOAA
4301 Rickenbacker Causeway
Miami, FL 33149
Office: 305.361.4322 Fax: 305.361.4392