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 #62708 is a reply to message #62705] Tue, 23 September 2008 10:25 Go to previous messageGo to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> 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.

This looks like the right thing but doesn't seem to give the right
answer (or am I using it wrong?)

;; this is my data
array=findgen(15,3)
;; and get the 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] ])

IDL> print, verts
0.00000 0.00000 0.00000
1.00000 0.500000 0.0333333
0.00000 1.00000 0.0666667
1.00000 1.50000 0.100000
0.00000 2.00000 0.133333
1.00000 2.50000 0.166667

The z values that are here are not in my original array...

Sorry to hijack your post Paula,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
[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 15:59:46 PDT 2025

Total time taken to generate the page: 0.00444 seconds