I have a 3D array and want to interpolate it into a finer resolution grid. The 3D array is defined on a regular grid with even spacing. The interpolation is also on a regular grid with even spacing. The step size is 2^(-n), n=0,1,2,3 ...
. Interpolation should be either linear or higher order Bspline. For example, a 3D array a
has sizes of (3,3,5) and the step size of the interpolation grid is (0.5, 0.5, 0.5)
(n=1). Then the interpolation grid is defined as
x=np.linspace(0,2,num=5) # 3/0.5-1 = 5
y=np.linspace(0,2,num=5) # 3/0.5-1 = 5
z=np.linspace(0,4,num=9) # 5/0.5-1 = 9
xx, yy, zz = np.meshgrid(x, y, z, sparse=True)
Then the output array should have sizes of (5,5,9). Which interpolation function in scipy or numpy can do the job in a most efficient way?