;------------------------------------------------------------- ;+ ; NAME: ; F_CBC ; PURPOSE: ; This function, calculates the weighting coefficients ; for the cubic convolution interpolation. ; CATEGORY: ; MATHEMATICAL ; CALLING SEQUENCE: ; aj = f_cbc(ox,oxj,oh) ; INPUTS: ; ox = The x-value at which you are interpolating using ; cubic convolution. ; type: scalar,integer or floating point ; oxj = A vector containing the given x values. ; type: scalar,integer or floating point ; oh = The value of one unit length interval. ; type: scalar,integer or floating point ; KEYWORD PARAMETERS: ; OUTPUTS: ; aj = A vector containing the weighting coefficients ; for the cubic convolution interpolation. ; type: scalar,integer or floating point ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; H. Cohl, 5 Feb, 1991 --- Initial implementation. ;- ;------------------------------------------------------------- function f_cbc,ox,oxj,oh,help=help ;Display idl header if help is required. if keyword_set(help) or n_params() lt 3 then begin get_idlhdr,'f_cbc.pro' aj=-1 goto,finishup endif ;Convert values to floating point. x=ox*1. xj=oxj*1. h=oh*1. aj=oxj ;Calculate distances of xj to x. z=abs((x-xj)/h) for i=0,4 do begin if (z(i) le 1.) then aj(i)=1.-(2.5*z(i)^2)+(1.5*z(i)^3) else \$ if (z(i) le 2.) then aj(i)=2.-(4.*z(i))+(2.5*(z(i)^2))-(0.5*(z(i)^3)) else \$ aj(i)=0. endfor finishup: return,aj end