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

Home » Public Forums » archive » Re: Interpolating a regular 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: Interpolating a regular grid [message #47887 is a reply to message #47805] Tue, 07 March 2006 17:34 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
David Fanning wrote:
> To interpolate your gridded array, you need to know the *indices*
> of pressure and temperature. One way to find the proper indices
> is like this:
>
> xindex = Value_Locate(p, 700.6)
> xindex = yindex + ((700.6 - p[yindex])/(p[yindex+1] - p[yindex]))
>
> yindex = Value_Locate(t, 234.56)
> yindex = yindex + ((234.56- t[yindex])/(t[yindex+1] - t[yindex]))
>
> So, now, the value you are looking for is this:
>
> interpValue = Interpolate(array, xindex, yindex)

For what it's worth, the Motley library at

http://www.dfanning.com/hadfield/idl/README.html

has a function called MGH_LOCATE which will calculated one or more
"fractional index" values in the way you have shown. It also has cousins
MGH_LOCATE2 & MGH_LOCATE2A that do the same thing for 2-D curvilinear
arrays.

Note to self: I must update that library.


--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Previous Topic: IDL Unix Color Problem
Next Topic: Re: Plot sphere and ellipsoid(oblate,prolate,triaxial) by object graphics

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

Current Time: Fri Oct 10 15:26:29 PDT 2025

Total time taken to generate the page: 1.04294 seconds