MGH_INTERPOLATE
Name
MGH_INTERPOLATE
Purpose
This function is a wrapper for the standard IDL INTERPOLATE
function. It corrects for the anomalous way INTERPOLATE
handles locations near the upper end of the input array, described
by the IDL documentation as follows:
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.
Note the final sentence. It is much more logical to treat points
in the range n-1 < x < n as missing, and this is what
MGH_INTERPOLATE does. Note also that the anomalous behaviour
described in the paragraph above is actually done only in the case
of linear interpolation, whereas bilinear interpolation acts in
the way I consider logical.
Calling Sequence
result = MGH_INTERPOLATE(p, x)
result = MGH_INTERPOLATE(p, x, y)
result = MGH_INTERPOLATE(p, x, y, z)
Parameters
See documentation for INTERPOLATE.
Return Value
The function returns a single or double precision floating point
array with size & shape determined by the x, y & z parameters and
the GRID keyword.
###########################################################################
Copyright (c) 2002 NIWA:
http://www.niwa.co.nz/
Licensed under the MIT open source license:
http://www.opensource.org/licenses/mit-license.php
###########################################################################
Modification History
Mark Hadfield, 2002-06:
Written.