X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 May 2011 03:43 PM by  anon
interpolation with three arrays from data table
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 May 2011 03:43 PM
    Dear IDL users, I am new to IDL and I cannot figure out a particular problem: I have F(x,y) values for discrete x and y points. In other words, I have three vectors F[], x[], y[] that I read from a tabulated text file. In x[] and y[] arrays, there are the coordinate points where corresponding F values are written in F[] array. All three arrays, naturally, have the same number of elements. I want to find F in some arbitrary (x',y') point. I tried the interpolate function but did not quite succeed. Also, it is inconvenient since it requires defining new x'[],y'[] arrays.. I could still live with it but even then I could not get it work. Also I want to plot F(x,y). I used p=plot3D(x,y,F) and it plots but draws lines instead of filled surface plot. I want to do this by the Surface function instead. I also tried iimage,F,x,y but it gave errors. I guess iimage is not used this way.. I will deeply appreciate your help. Thanks, - Nevzat

    Deleted User



    New Member


    Posts:
    New Member


    --
    08 Jul 2011 03:31 PM
    Hi Nevzat, What about the following lines of code. They use BILINEAR(), which uses a bilinear interpolation algorithm to compute the value of a data array at each of a set of subscript values: P = FINDGEN(3,3) IX = 0.5 ;Define the X subscript. JY = 0.0 ;Define the Y subscript. Z = BILINEAR(P, IX, JY) ;Interpolate. PRINT, Z ;Print the value at the point IX,JY within P. ;Suppose we wish to find the values of a 2 x 2 array of points in P. Create the subscript arrays IX and JY: IX = [[0.5, 1.9], [1.1, 2.2]] ;Define the X subscripts. JY = [[0.1, 0.9], [1.2, 1.8]] ;Define the Y subscripts. Z = BILINEAR(P, IX, JY) ;Interpolate. PRINT, Z ;Print the array of values. And for the surface, you could use the SURFACE function that is available in the new graphics of IDL 8.1. For example: hanning=hanning(500,500) surf_hann = SURFACE(hanning, COLOR='light_blue')
    You are not authorized to post a reply.