语法是:Result = BILINEAR(P, IX, JY [, MISSING=value] )
p:是原来没有插值的那个数组,一般应该是两维的,如果是网格的话就相当于x,y两维。
ix和jy都是相对坐标,是我们要插值的这个点相对于原坐标系的一个相对ix,iy。如果我们只差值一个点,则计算相对的坐标带入语法中就可以了。
这是范例:
P = FINDGEN(3,3)
Suppose we wish to find the value of a point half way between the first and second elements of the first row of P. Create the subscript arrays IX and JY:
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.
IDL prints:
0.500000
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.
IDL prints:
0.800000 4.60000
4.70000 7.40000