I am rewriting colleagues IDL code in python and coming up with some differences that confuse me. According to other SO questions and the conversations I found, if you use scipy.ndimage.interpolation.map_coordinatesand specify order=1, it is assumed that it will be bilinear interpolation. When comparing the results between the IDL code (executed in GDL) and python (map_coordinates), I had different results. Then I tried to use mpl_toolkits.basemap.interp, and got the same result as the IDL code. The following is a simple example showing what is wrong. Can someone help me figure out what I'm doing wrong with map_coordinatesor order=1not bilinearly?
from scipy.ndimage.interpolation import map_coordinates
from mpl_toolkits.basemap import interp
import numpy
in_data = numpy.array([[ 25.89125824, 25.88840675],[ 25.90930748, 25.90640068]], dtype=numpy.float32)
map_coordinates(in_data, [[0.0],[0.125]], order=1, mode='nearest')
interp(in_data, numpy.array([0,1]), numpy.array([0,1]), numpy.array([0.0]), numpy.array([0.125]), order=1)
interp, , map_coordinates . , map_coordinates , ? ?