![](https://secure.gravatar.com/avatar/da3a0a1942fbdc5ee9a9b8115ac5dae7.jpg?s=120&d=mm&r=g)
ke, 2009-09-16 kello 15:28 -0700, John [H2O] kirjoitti:
Robert Kern-2 wrote:
Ah, yes. griddata() only handles regular grids for some reason, not arbitrary interpolation points. You will have to use the underlying delaunay package to interpolate arbitrary points. Using your variable names:
# triangulate data tri = delaunay.Triangulation(x,y) # interpolate data interp = tri.nn_interpolator(z) Z0 = interp(gridx, gridy)
--
I'd like to revive the thread if I may... I'm now able to use the projected coordinate system and do a regridding using the griddata function. But I would like to use the Triangulation approach.
Unfortunately, I get the following error after some time: terminate called after throwing an instance of 'std::bad_alloc'
Any thoughts on what may be causing this?
It's a C++ exception, indicating that something runs out of memory. The triangulation generation in scikits.delaunay is written in C++, so this probably means that you have more data points than the triangulator can handle. The code does not catch bad_alloc exceptions, so this results to termination of the program rather than in a MemoryError. -- Pauli Virtanen