MGH_LOCATE
Name
MGH_LOCATE
Purpose
This function calculates translates positions in physical space into
the "index space" of a 1D vector.
Calling Sequence
Result = MGH_LOCATE(xin)
Positional Parameters
xin (input, 1-D numeric array)
X positions of the vertices of the input grid. The X values
should be monotonic (if not, results will be unpredictable);
they need not be uniform.
Keyword Parameters
The following keywords define the locations in physical space of
the output grid, cf. the GRIDDATA routine: DELTA, DIMENSION, START, XOUT.
In addition:
EXTRAPOLATE (input, switch)
Set this keyword to cause output locations outside the
range of input values to be determined by extrapolation.
MISSING (input, numeric scalar)
Value used for locations outside the range of input
values. Ignored if the EXTRAPOLATE keyword is set.
Default is NaN.
SPLINE (input, switch)
Set this keyword to use spline interpolation; default is linear.
Setting both the SPLINE and EXTRAPOLATE keywords together
causes an error.
Return Value
The function returns a floating array representing the output
location as fractional indices on the grid represented by
XIN. The result has the same dimensions as the output locations.
Procedure
Construct variable representing position in i direction &
interpolate.
###########################################################################
Copyright (c) 2002-2012 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-07:
Written.
Mark Hadfield, 2003-01:
Now calls IDL library routine INTERPOL instead of MGH_INTERPOL.
Mark Hadfield, 2004-03:
Added SPLINE keyword.