;+ ; NAME: ; POLINT_ARR ; PURPOSE: ; Aproximate fnc-values in X by interpolating polynomial of XA,YA ; CATEGORY: ; Math: interpolation and extrapolation ; CALLING SEQUENCE: ; Y = polint_arr( XA,YA, X) ; INPUTS: ; XA array X-values where fnc-values are knowm ; YA array known fnc-values in X ; X array X-values where fnc-values are required ; OUTPUTS: ; Y array interpolated fnc-values in X ; CALLS: ; call_external ; PROCEDURE: ; Calls the Fortran subroutine NR_POLINT ; MODIFICATION HISTORY: ; JUN-1993, Paul Hick (UCSD) ;- function POLINT_ARR, XA,YA, X, plt=plt, oplt=oplt N = long(n_elements(XA)) ; Integer*4 XB = float(XA) ; Real*4 YB = float(YA) XC = float(X) YOUT = 0. DY = 0. M = n_elements(X) Y = fltarr(M) ; Create output array for J=0,M-1 do begin stat = call_external("EXEIDL","NR_POLINT",N,XB,YB,XC(J),YOUT,DY) Y(J) = YOUT ; Y(J) cannot be used directly as argument endfor if keyword_set( plt) then plot, X,Y else $ if keyword_set(oplt) then oplot, X,Y return, Y & end