Basemap toolkit: problem with polarplot example

Hi, the pyproj package seems to cause a problem in the polarmap example of the basemap toolkit.

Thanks,

david

huardda@…559…:~/svnrepos/toolkits/basemap/examples$ python polarmaps.py
min/max etopo20 data:

-9026.625 6228.8125
plotting North Polar Lambert Azimuthal Equal Area basemap …
plotting North Polar Stereographic basemap …
plotting North Polar Azimuthal Equidistant basemap …
Traceback (most recent call last):

File “polarmaps.py”, line 51, in ?
resolution=‘c’,area_thresh=10000.,lat_0=lat_0,lon_0=lon_0_ortho)
File “/usr/local/lib/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py”, line 1111, in init

az1,alpha21,dist=gc.inv(lon_0,lat_0,math.radians(lonsnew[0]),math.radians(latsnew[0]),radians=True)

File “/usr/local/lib/python2.4/site-packages/matplotlib/toolkits/basemap/pyproj.py”, line 478, in inv

_Geod._inv(self, inx, iny, inz, ind, radians=radians)

File “_geod.pyx”, line 123, in _geod.Geod._inv
ValueError: undefined inverse geodesic (may be an antipodal point)

This is from a fresh SVN version of both matplotlib and basemap. Linux, Ubuntu edgy, Xeon-64.

David Huard wrote:

Hi, the pyproj package seems to cause a problem in the polarmap example of the basemap toolkit.

Thanks,

david

huardda@...559...:~/svnrepos/toolkits/basemap/examples$ python polarmaps.py
min/max etopo20 data:
-9026.625 6228.8125
plotting North Polar Lambert Azimuthal Equal Area basemap ...
plotting North Polar Stereographic basemap ...
plotting North Polar Azimuthal Equidistant basemap ...
Traceback (most recent call last):
  File "polarmaps.py", line 51, in ?
    resolution='c',area_thresh=10000.,lat_0=lat_0,lon_0=lon_0_ortho)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py", line 1111, in __init__
    az1,alpha21,dist=gc.inv(lon_0,lat_0,math.radians(lonsnew[0]),math.radians(latsnew[0]),radians=True)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/toolkits/basemap/pyproj.py", line 478, in inv
    _Geod._inv(self, inx, iny, inz, ind, radians=radians)
  File "_geod.pyx", line 123, in _geod.Geod._inv
ValueError: undefined inverse geodesic (may be an antipodal point)

This is from a fresh SVN version of both matplotlib and basemap. Linux, Ubuntu edgy, Xeon-64.

David: Odd - I can't reproduce that on my mac. Can you try this

>>> from matplotlib.toolkits.basemap import pyproj
>>> pyproj.test()

and let me know if any of the tests fail?

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...236...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg