On Wed, Nov 9, 2011 at 10:19 AM, Kay F. Jahnke <_kfj@yahoo.com> wrote:
I did have lines over 80 chars after all...

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

> This doesn't answer your specific question, but look at
> scipy.ndimage.map_coordinates()
> for general-purpose spline interpolation of regularly-spaced (e.g. image)
> data. If you want to repeatedly interpolate the same data, you can get the
> spline coefficients with:
> scipy.ndimage.spline_filter() and pass them to map_coordinates()
> with the "prefilter=False" option.

Thank you very much for your helpful hint. I tried out the code you suggested
and it seems to do just what I want. It seems to me that I can also process the
coefficient matrix I get from signal.cspline2d() with ndimage.map_coordinates()
as well as being able to have ndimage.spline_filter() generate the coefficients,
though the coefficient matrices the two routines provide aren't identical.


I believe they both use the same algorithm, i.e., uniform b-splines and prefiltering to get the coefficients, but the boundary conditions may be different. I think the one in signal uses reflection at the ends, which is the common case. Of course, one of the routines may also be buggy ;)

<snip>

Chuck