griddata array size limit?

Hi! I am basing my code off the example posted at:
http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
Gridding irregularly spaced data

When I use my own data, I am getting a KeyError (Posted below)

However, if I only use a subset of my data (for which the total
length=26328), I can get rid of the error:

# This subset works
# I incremented the final index until I got the error
# Length: 19877
x=np.array(R[0:19876])
y=np.array(Z[0:19876])
z=np.array(volt[0:19876])

# And this subset works
# I incremented the starting index until I got the error
# Length: 19040
x=np.array(R[7288:-1])
y=np.array(Z[7288:-1])
z=np.array(volt[7288:-1])

The weird thing is that these two lengths are different. There doesn't seem
to be anything particularly strange about the values near 19876 or 7288.
Any ideas?
-Tom

##############Error Message #######################

---> 81 zi = griddata(x,y,z,xi,yi)
     82 # contour the gridded data, plotting dots at the randomly spaced
data points.
     83 CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k')

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mlab.pyc
in griddata(x, y, z, xi, yi)
   2940 xi,yi = np.meshgrid(xi,yi)
   2941 # triangulate data
-> 2942 tri = delaunay.Triangulation(x,y)
   2943 # interpolate data
   2944 interp = tri.nn_interpolator(z)

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/delaunay/triangulate.pyc
in __init__(self, x, y)
     86 self.triangle_neighbors = delaunay(self.x, self.y)
     87
---> 88 self.hull = self._compute_convex_hull()
     89
     90 def _collapse_duplicate_points(self):

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/delaunay/triangulate.pyc
in _compute_convex_hull(self)
    121 hull = list(edges.popitem())
    122 while edges:
--> 123 hull.append(edges.pop(hull[-1]))
    124
    125 # hull[-1] == hull[0], so remove hull[-1]

KeyError: 2559

···


View this message in context: http://www.nabble.com/griddata-array-size-limit--tp24827814p24827814.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

tfoutz99,

I occasionally run into this issue as well. At quick glance I suspect it
may be related to the limitation listed at:
http://www.scipy.org/scipy/scikits/ticket/61
...but I could be way off base as I'm not sure if the code is derived from
the same place.

-Erik

tfoutz99 wrote:

···

Hi! I am basing my code off the example posted at:
http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
Gridding irregularly spaced data

When I use my own data, I am getting a KeyError (Posted below)

However, if I only use a subset of my data (for which the total
length=26328), I can get rid of the error:

# This subset works
# I incremented the final index until I got the error
# Length: 19877
x=np.array(R[0:19876])
y=np.array(Z[0:19876])
z=np.array(volt[0:19876])

# And this subset works
# I incremented the starting index until I got the error
# Length: 19040
x=np.array(R[7288:-1])
y=np.array(Z[7288:-1])
z=np.array(volt[7288:-1])

The weird thing is that these two lengths are different. There doesn't
seem to be anything particularly strange about the values near 19876 or
7288. Any ideas?
-Tom

##############Error Message #######################

---> 81 zi = griddata(x,y,z,xi,yi)
     82 # contour the gridded data, plotting dots at the randomly spaced
data points.
     83 CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k')

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mlab.pyc
in griddata(x, y, z, xi, yi)
   2940 xi,yi = np.meshgrid(xi,yi)
   2941 # triangulate data
-> 2942 tri = delaunay.Triangulation(x,y)
   2943 # interpolate data
   2944 interp = tri.nn_interpolator(z)

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/delaunay/triangulate.pyc
in __init__(self, x, y)
     86 self.triangle_neighbors = delaunay(self.x, self.y)
     87
---> 88 self.hull = self._compute_convex_hull()
     89
     90 def _collapse_duplicate_points(self):

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/delaunay/triangulate.pyc
in _compute_convex_hull(self)
    121 hull = list(edges.popitem())
    122 while edges:
--> 123 hull.append(edges.pop(hull[-1]))
    124
    125 # hull[-1] == hull[0], so remove hull[-1]

KeyError: 2559

--
View this message in context: http://www.nabble.com/griddata-array-size-limit--tp24827814p25026351.html
Sent from the matplotlib - users mailing list archive at Nabble.com.