;+ ;FUNCTION splfunc2 ;USAGE: ; p = splfunc2(x_old,y_old,/set) ; y = splfunc2(x_new,y_new,param=p) ; This is a doctored file that allows the independent variable to be in the second position (use with rk4_rep) ;- function splfunc2, xs,ys, param=p,xlog=xlog,ylog=ylog,lininterp=lininterp,set=set common splfunc2_com,param xl = keyword_set(xlog) yl = keyword_set(ylog) li = keyword_set(lininterp) if size(/type,p) eq 8 then param=p if not keyword_set(param) or keyword_set(set) then begin w = where(finite(xs) and finite(ys)) xps = float(xl ? alog10(xs[w]) : xs[w]) yps = double(yl ? alog10(ys[w]) : ys[w]) s = sort(xps) xps=xps[s] yps=yps[s] ; interp_gap,xps,yps param = {func:'splfunc2', x: xps, y: yps, xlog:xl, ylog:yl, li:li} endif p = param if keyword_set(set) then return,p if p.li then f= interp(p.y,p.x,p.xlog ? alog10(ys) : ys) else begin ys2 = spl_init(p.x,p.y) f = spl_interp(p.x,p.y,ys2,p.xlog ? alog10(ys) : ys) endelse return, p.ylog ? 10.^f : f end