[SciPy-User] faster interpolations (interp1d)

eat e.antero.tammi@gmail....
Tue Mar 1 01:31:13 CST 2011


Hi James,

On Mon, Feb 28, 2011 at 5:25 PM, James McCormac <jmccormac01@qub.ac.uk>wrote:

> Hi eat,
> you sent me a suggestion for faster 1d interpolations using matrices a few
> weeks back but I cannot find the email anywhere when I looked for it
> today.
>
> Here is a better explanation of what I am trying to do. For example I have
> a 1d array of 500 elements. I want to interpolate them quadratically so
> each array becomes 10 values, 50,000 in total.
>
> I have 500x500 pixels and I want to get 0.01 pixel resolution.
>
> code snipet:
> # collapse an image in the x direction
> ref_xproj=np.sum(refarray,axis=0)
>
> # make an array for the 1d spectra
> x = np.linspace(0, (x_2-x_1), (x_2-x_1))
>
> # interpolation
> f2_xr = interp1d(x, ref_xproj, kind='quadratic')
>
> # new x array for interpolated data
> xnew = np.linspace(0, (x_2-x_1), (x_2-x_1)*100)
>
> # FFT of interpolated spectra
> F_ref_xproj = fftpack.fft(f2_xr(xnew))
>
> Can I do this type of interpolation faster using the method you described
> before?
>
I'll misinterpreted your original question and the method I suggested there
is not applicable.

To better understand your situation, few questions:
- what you described above; it does work for you in technical sense?
- if so, then the problem is with the execution performance?
- what are your current timings?
- how much you'll need to enhance them?

Regards,
eat

>
> Cheers
> James
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110301/88a21c68/attachment.html 


More information about the SciPy-User mailing list