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

Home » Public Forums » archive » Re: what is the best way to do a surface (or 2D) interpolation?
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: what is the best way to do a surface (or 2D) interpolation? [message #62710 is a reply to message #62709] Tue, 23 September 2008 10:14 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Sep 23, 11:54 am, Brian Larsen <balar...@gmail.com> wrote:
> I think what you are looking for is krig2d.  Look it up in help.  The
> only annoyance is that it is either looking for a regular grid (which
> I think you have) or x,y,z triplets.  I have never figured out how to
> make x,y,z triplets other than using nested for loops to step through
> the points.
>
> From here read the krig2d help and work through the example there and
> see if that solves your issue.  If not let me know whats not working
> and I'll see if I can help more.
>
> One word of caution is that interpolation is great "inside" the range
> where you have data, however "outside" the region is extrapolation and
> is fraught with issues.  I mean that your x's
> IDL> print,vz
>      -1.62839     -1.23045    -0.628389    -0.327359    0.0483046
> 0.246672
> and the new x's that you want
> newx = [-2.0, -1.5, -1.0, -0.5, 0.0, 0.5]
> some are outside and you need to be a little careful that the answer
> actually makes sense as if often (maybe stronger than often) doesn't.
>
> Cheers,
>
> Brian
>
> ------------------------------------------------------------ --------------
> Brian Larsen
> Boston University
> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL

Here's a way to get verts:

sz = size(array)
nx = sz[0]
ny = sz[1]
nz = sz[2]
ns = sz[sz[0]+2]
verts = findgen(ns)
verts = transpose([ [verts mod nx], [verts/nx mod ny], [verts/nx/
ny] ])

BTW, I'd like to find a faster way, if there is one.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Getting array indices
Next Topic: giving input to fortran program using spawn in IDL

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

Current Time: Wed Oct 08 17:52:41 PDT 2025

Total time taken to generate the page: 0.24179 seconds