What would be a python equivalent for the INTERPOL function as seen in the following IDL code:
x = interpol(a,b,c)
Thank You
What would be a python equivalent for the INTERPOL function as seen in the following IDL code:
x = interpol(a,b,c)
Thank You
In your notation, the IDL interp function uses a as the input values, b as input abscissa values and c is the desired abscissa values you want to interpolate onto.
In python (for 1D) it would be scipy.interpolate.interp1d:
from scipy import interpolate
interpfunc = interpolate.interp1d(b,a, kind='linear')
x=interpfuc(c)
scipy includes many more interpolation functions, including interp2d and griddata that you may find useful: http://docs.scipy.org/doc/scipy/reference/interpolate.html