[SciPy-User] [basemap] robin projection rotate_vector segfaults on nans

Gerrit Holl gerrit.holl@ltu...
Mon Nov 22 08:15:59 CST 2010


I have found a bug in basemap. When using the robin projection,
Basemaps rotate_vector method segfaults if the input vectors consist
of nans.

I have reported this as bug 3115514:

This piece of code reproduces the bug:

import numpy
import mpl_toolkits.basemap

lon = numpy.linspace(-180, 180, 65)
lat = numpy.linspace(-85, 85, 32)
u = numpy.zeros((32, 65))
v = numpy.zeros((32, 65))
u[:] = numpy.nan
v[:] = numpy.nan
m = mpl_toolkits.basemap.Basemap(projection="robin", lon_0=0)
print "rotating vector..."
(U, V, X, Y) = m.rotate_vector(u, v, lon, lat, returnxy=True)
print "never reached, segfaulting :("

It appears to work fine for other projections (I tried default and ortho).

Can others reproduce it as well?


More information about the SciPy-User mailing list