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

Home » Public Forums » archive » Re: Nearest Neighbor ... again!
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: Nearest Neighbor ... again! [message #71627 is a reply to message #71625] Thu, 08 July 2010 09:27 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 8, 10:40 am, Fabzi <fabien.mauss...@gmail.com> wrote:
> I am sorry, I did not make clear that grid1 and grid2 are two
> different irregular grids (lat1,lon1),(lat2,lon2). It is indeed
> classical, I know, and I feel quite embarrassed!
>
> So the code here:
>
>   n1 = n_elements(ilon)
>   triangulate, x1, y1, c ; Compute Delaunay triangulation
>   out = GRIDDATA(x1,y1, LINDGEN(n1), XOUT=x2, YOUT=y2, /NEAREST_N,
> TRIANGLES = c)
>
> Is giving me, for each point in Grid2, the index of the closest point
> in grid1. My question is, how to get the four closest points? The "bad
> trick" that I used with GRIDDATA won't work here...


If you need to interpolate from one irregular rectangular grid to the
other, you can use bilinear() or interpolate(). There are several
other options if the output grid is regular. If you really need the
nearest points, voronoi() might serve.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sale HAMILTON watches(www.nike-black.com)
Next Topic: diffusion list on GDL

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

Current Time: Fri Oct 10 08:31:15 PDT 2025

Total time taken to generate the page: 1.27917 seconds