The INTERPOLATE function returns an array of linear, bilinear or trilinear interpolates, depending on the dimensions of the input array P . Linear interpolates are returned in the one-dimensional case, bilinear in the two-dimensional case and trilinear interpolates in the three-dimensional case. The returned array has the same type as P and its dimensions depend on those of the location parameters X , Y , and Z , as explained below.
Interpolates outside the bounds of P can be set to a user-specified value by using the MISSING keyword.
Arrays of numeric type containing the locations for which interpolates are desired. For linear interpolation ( P is a vector), the result has the same dimensions as X. The i -th element of the result is P interpolated at location X i . The Y and Z parameters should be omitted.
NOTE: INTERPOLATE considers location points with values between zero and n , where n is the number of values in the input array P , to be valid. Location points outside this range are considered missing data. Location points x in the range n -1 £ x < n return the last data value in the array P .
If the keyword GRID is not set, all location arrays must have the same number of elements. See the description of the GRID keyword below for more details on how interpolates are computed from P and these arrays.
Set this keyword to a value between -1 and 0 to use the cubic convolution interpolation method with the specified value as the interpolation parameter. Setting this keyword equal to a value greater than zero specifies a value of -1 for the interpolation parameter. Park and Schowengerdt (see reference below) suggest that a value of -0.5 significantly improves the reconstruction properties of this algorithm.
Cubic convolution is an interpolation method that closely approximates the theoretically optimum sinc interpolation function using cubic polynomials. According to sampling theory, details of which are beyond the scope of this document, if the original signal, f , is a band-limited signal, with no frequency component larger than w 0 , and f is sampled with spacing less than or equal to 1/(2 w 0 ), then f can be reconstructed by convolving with a sinc function: sinc( x ) = sin( p x ) / ( p x ).
In the one-dimensional case, four neighboring points are used, while in the two-dimensional case 16 points are used. Note that cubic convolution interpolation is significantly slower than bilinear interpolation.
In the case of bilinear interpolation, the result is obtained as follows: Let l = Î X i ° and k = Î Y i ° . Element i of the result is computed by interpolating between P ( l, k ), P ( l +1, k ), P ( l , k +1), and P ( l +1, k +1). to obtain the estimated value at ( Xi , Yi ). Trilinear interpolation is a direct extension of the above.
If GRID is set: Let N x be the number of elements in X , let N y be the number of elements in Y , and N z be the number of elements in Z . The result has dimensions ( N x , N y ) for bilinear interpolation, and ( N x , N y , N z ) for trilinear interpolation. For bilinear interpolation, element ( i , j ) of the result contains the value of P interpolated at position ( Xi , Yi ). For trilinear interpolation, element ( i , j , k ) of the result is P interpolated at ( Xi , Yi , Zi ).
The value to return for elements outside the bounds of P . If this keyword is not specified, interpolated positions that fall outside the bounds of the array P --that is, elements of the X , Y , or Z arguments that are either less than zero or greater than the largest subscript in the corresponding dimension of P --are set equal to the value of the nearest element of P .
corresponding to the locations (.5,.5), (1.5, 1.5), (2.5, 2.5) and (3.1, 2.0). Note that the last location is outside the bounds of P and is set from the value of the last column. The following command uses the MISSING keyword to set such values to -1: