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.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
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.