[SciPy-User] how can I create B-splines of mutidimensional values?

Kay F. Jahnke _kfj@yahoo....
Mon Nov 28 07:03:20 CST 2011

Zachary Pincus <zachary.pincus <at> yale.edu> writes:

> scipy.ndimage.map_coordinates() performs b-spline
> interpolation of regularly-spaced data

my data are pairs of numbers, like complex numbers.
I can't see a way of processing them.

> (spline
> order 0-5, with several options for boundary conditions).
> The syntax can seem a bit tricky at first, and
> you need to watch out for ringing artifacts at sharp
> transitions (as these are interpolating splines),
> but it should do the trick.
> Zach

Thanks, Zach, but I tried all the routines in interpolate,
ndimage and signal, and all of these only seem to use use
one-dimensional values. Using the routines in ndimage, I
can easily have a 3D array of floats and interpolate at
arbitrary 3D coordinates, but this is not what I want.
I want multidimensional values, not coordinates. My
coordinates are plain 2D x,y coordinates, but the values
defined over them are pairs of numbers.

My data would look something like:

(V1,V2) (V1,V2) .... (V1,V2)
(V1,V2) (V1,V2) .... (V1,V2)
(V1,V2) (V1,V2) .... (V1,V2)

(a 2D matrix of pairs)

I'd expect a spline coefficient matrix of the same shape

(C1,C2) (C1,C2) ... (C1,C2)
(C1,C2) (C1,C2) ... (C1,C2)
(C1,C2) (C1,C2) ... (C1,C2)

and, when interpolating at (x,y) I'd like a result


(a single pair)


More information about the SciPy-User mailing list