[SciPy-user] Arrayfns in numpy?

Stephen Kelly steveire@gmail....
Tue Mar 6 04:54:19 CST 2007


Hi,

Thanks for the reply.

I don't want to depend on scipy for a small task like this. I want to keep
dependencies small.

I looked at the searchsorted function, but don't see how it would be useful.
My data is not regularly spaced. It is X-ray diffraction data in which each
intensity has been shifted slightly. I am currently using arrayfns from
Numeric to get data with regular spacing. Could you give more information on
how to interpolate the data? I don't know where to start.

As an aside, here's some things in Numeric that aren't in numpy. Is this
oversight, or are there no plans to implement them?
1. arrayfns module
2. UserArray module with UserArray class (comparible to UserDict, UserList).

Kind regards,

Stephen.

On 3/5/07, Alok Singhal <as8ca@virginia.edu> wrote:
>
> On 05/03/07: 20:24, Stephen Kelly wrote:
> >    Is there some other way I should be doing interpolation using numpy,
> >    or is the omission of arrayfns an oversight?
>
> You could use the functions in scipy.interpolate.  For linear
> interpolation, use something like:
>
> from scipy.interpolate import interp1d
>
> # x, y are the original data values
> intp = interp1d(x, y)
>
> # xx is an array of new x values for which to interpolate (or just a
> # scalar)
> yy = intp(xx)
>
> If you can't use scipy, then it shouldn't be too hard to write your
> own linear interpolation function.  You might find searchsorted()
> function useful in that case (in case your original x data is not
> regularly spaced).
>
> -Alok
>
> --
> Alok Singhal                               *   *
> Graduate Student, dept. of Astronomy   *           *     *
> University of Virginia
> http://www.astro.virginia.edu/~as8ca/              *    *
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070306/7407dd8c/attachment-0001.html 


More information about the SciPy-user mailing list