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

Home » Public Forums » archive » Re: resampling on irregular grid
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: resampling on irregular grid [message #80380] Fri, 08 June 2012 06:00 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
When I re-sampling grids I normally use nearest neighbour interpolation. I create a matrix with the "projection" indices.
Something like :

FOR i=0l, N_ELEMENTS(lon_cart)-1 DO BEGIN

diff=(lon1-lon_cart[i])^2.+(lat1-lat_cart[i])^2.
min_latlon=MIN(diff,pos)

IF min_latlon LE tol THEN BEGIN
cart_xindex[i]=(pos MOD nlon)
cart_yindex[i]=(pos / nlon) + yy_ini
ENDIF
ENDFOR

This loop normally takes a lot of time but if one of your grids is regular you can improve it.
Hope this will help !

nata
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to write to file ?
Next Topic: need help

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

Current Time: Wed Oct 08 16:16:42 PDT 2025

Total time taken to generate the page: 0.00196 seconds