![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
![]() |
TABINV
To find the effective index of a function value in an ordered vector.
TABINV, XARR, X, IEFF, [/FAST]
XARR - the vector array to be searched, must be monotonic
increasing or decreasing
X - the function value(s) whose effective
index is sought (scalar or vector)
IEFF - the effective index or indices of X in XARR
real or double precision, same # of elements as X
/FAST - If this keyword is set, then the input vector is not checked
for monotonicity, in order to improve the program speed.
TABINV will abort if XARR is not monotonic. (Equality of
neighboring values in XARR is allowed but results may not be
unique.) This requirement may mean that input vectors with padded
zeroes could cause routine to abort.
VALUE_LOCATE() is used to find the values XARR[I]
and XARR[I+1] where XARR[I] < X < XARR[I+1].
IEFF is then computed using linear interpolation
between I and I+1.
IEFF = I + (X-XARR[I]) / (XARR[I+1]-XARR[I])
Let N = number of elements in XARR
if x < XARR[0] then IEFF is set to 0
if x > XARR[N-1] then IEFF is set to N-1
Set all flux values of a spectrum (WAVE vs FLUX) to zero
for wavelengths less than 1150 Angstroms.
IDL> tabinv, wave, 1150.0, I
IDL> flux[ 0:fix(I) ] = 0.
None
Adapted from the IUE RDAF January, 1988
More elegant code W. Landsman August, 1989
Mod to work on 2 element decreasing vector August, 1992
Converted to IDL V5.0 W. Landsman September 1997
Updated for V5.3 to use VALUE_LOCATE() W. Landsman January 2000
Work when both X and Xarr are integers W. Landsman August 2001
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]