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

Home » Public Forums » archive » Re: mapping/interpolation from one irregular grid to another (different) 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: mapping/interpolation from one irregular grid to another (different) irregular grid. [message #79019 is a reply to message #79007] Tue, 24 January 2012 23:38 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi Paul,

If I understand you right, I'd say GridData is at least worth a try. Online help has several examples, but none doing quite what you want. Using the variables from there (scattered points f as a function of x and y):

; Create a dataset of N points.
n = 100 ;# of scattered points
seed = -121147L ;For consistency
x = RANDOMU(seed, n)
y = RANDOMU(seed, n)

; Create a dependent variable in the form a function of (x,y)
; with peaks & valleys.
f = 3 * EXP(-((9*x-2)^2 + (7-9*y)^2)/4) + $
3 * EXP(-((9*x+1)^2)/49 - (1-0.9*y)) + $
2 * EXP(-((9*x-7)^2 + (6-9*y)^2)/4) - $
EXP(-(9*x-4)^2 - (2-9*y)^2)

; -----
; Then, create another set of irregular (x, y)
; points to sample, and sample them:

xOut = RandomU(seed, n)
yOut = RandomU(seed, n)
fOut = GRIDDATA(x, y, f, XOut=xOut, YOut=yOut)

; -----
; To confirm that the gridding of this small set of points is
; doing what we intend, these two contour plots bear some similarity:

!P.Multi=[0,1,2]
Contour, f, x, y, /IRREGULAR, LEVEL=FIndGen(11)/10*5, /FOLLOW
Contour, fOut, xOut, yOut, /IRREGULAR, LEVEL=FIndGen(11)/10*5, /FOLLOW

There are loads of options in GridData for interpolation methods, etc.

Hope this is helpful in some way.

Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada
www.d-jackson.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Calling all DLM experts- debugging in MSVC++ 2010
Next Topic: fatal error : double free or corruption (!prev)

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

Current Time: Tue Oct 14 05:37:32 PDT 2025

Total time taken to generate the page: 1.76343 seconds