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

Home » Public Forums » archive » Re: Multidimensional 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: Multidimensional Interpolation [message #35772 is a reply to message #35771] Mon, 21 July 2003 11:27 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 21 Jul 2003 08:40:58 -0700, Ian Chapman wrote:

> Hi,
>
> I have created a 5 dimensional data cube (pressure, temperature,
> relative humidity, frequency, transmission) with a radiative transfer
> model. I have a user that will need to get transmission data for given
> values of the rest of the parameters, so I am currently planning to
> interpolate the cube to the input values of the user.
>
> Does anyone know of any multi-dimensional interpolation routines
> (similar to spline) that would be able to perform this task?
>


You could roll your own using VALUE_LOCATE to locate the point
(p,t,h,f) within each of the 4 relevant axes (bracketed between
i,j,k,l and i+1,j+1,k+1,l+1), and then perform quad-linear
interpolation on the 16 nearby grid points bracketing the desired
value. E.g., let:

a=(p-p[i])/(p[i+1]-p[i])
b=(t-t[i])/(t[j+1]-t[j])
c=(h-h[i])/(h[k+1]-h[k])
d=(f-f[i])/(f[l+1]-f[l])

The quad-linear interpolant over you whole data cube "z" would look
like:

(1-a)(1-b)(1-c)(1-d) z[i ,j ,k ,l ] +
(1-a)(1-b)(1-c) d z[i ,j ,k ,l+1] +
(1-a)(1-b) c (1-d) z[i ,j ,k+1,l ] +
(1-a)(1-b) c d z[i ,j ,k+1,l+1] +
(1-a) b (1-c)(1-d) z[i ,j+1,k ,l ] +
(1-a) b (1-c) d z[i ,j+1,k ,l+1] +
(1-a) b c (1-d) z[i ,j+1,k+1,l ] +
(1-a) b c d z[i ,j+1,k+1,l+1] +
a (1-b)(1-c)(1-d) z[i+1,j ,k ,l ] +
a (1-b)(1-c) d z[i+1,j ,k ,l+1] +
a (1-b) c (1-d) z[i+1,j ,k+1,l ] +
a (1-b) c d z[i+1,j ,k+1,l+1] +
a b (1-c)(1-d) z[i+1,j+1,k ,l ] +
a b (1-c) d z[i+1,j+1,k ,l+1] +
a b c (1-d) z[i+1,j+1,k+1,l ] +
a b c d) z[i+1,j+1,k+1,l+1]

The regularity of this pattern lends one to believe a generic n-linear
interpolation code could be written. Fancier interpolation methods
(cubic, spline, sinc) get much harder in higher dimensions.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: axis problem
Next Topic: can you easily make "test" data volumes with simple shapes?

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

Current Time: Sat Oct 11 03:52:10 PDT 2025

Total time taken to generate the page: 0.71864 seconds