Fixed bug related to numpy.interp, which requires increasing values for x-coordinates. Using scipy.interp1d  instead.