comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Interpolation question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: interpolation question [message #48393 is a reply to message #25895] Thu, 20 April 2006 07:50 Go to previous messageGo to previous message
chen123.dian is currently offline  chen123.dian
Messages: 4
Registered: April 2006
Junior Member
Thanks, Peter,

Your code works well for 1-D data. It will be nice to extend it to 2-D
data.

Regards,

Chen

Peter Albert wrote:
> Hi Chen,
>
> I haven't tested this extensively, but I would try
>
> nn = y[round(interpol(indgen(n_elements(x)),x, u))]
>
> where "x" and "y" are the, well, x and y values and "u" is the vector
> with x-values for which the nearest neighbours are to be found.
>
> What goes on?
>
> The interpol command interpolates the indices of the x and y vectors to
> the new locations, round actually finds the nearest neighbour in terms
> of index, and then we just assign y with those indices.
>
> Regards,
>
> Peter
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Length of command line input
Next Topic: ellipsoid 3D

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 15:57:05 PDT 2025

Total time taken to generate the page: 1.35352 seconds