Yes, you can use a scipy.interpolate.griddatamasked array as well, and you can choose the type of interpolation that you prefer, using an argument methodusually 'cubic'do an excellent job:
import numpy as np
from scipy import interpolate
array = np.random.random_integers(0,10,(10,10)).astype(float)
array[array>7] = np.nan
It looks something like this: plt.imshow(array,interpolation='nearest')

x = np.arange(0, array.shape[1])
y = np.arange(0, array.shape[0])
array = np.ma.masked_invalid(array)
xx, yy = np.meshgrid(x, y)
x1 = xx[~array.mask]
y1 = yy[~array.mask]
newarr = array[~array.mask]
GD1 = interpolate.griddata((x1, y1), newarr.ravel(),
(xx, yy),
method='cubic')
This is the end result:

See that if nan values are at the edges and surrounded by nan values, they cannot be interpolated and stored nan. You can change it using the argument fill_value.
, NaN 3x3, ?
, . , , , , . , .. , , , .
- :
reference = array[3:6,3:6].copy()
array[3:6,3:6] = np.nan
method = ['linear', 'nearest', 'cubic']
for i in method:
GD1 = interpolate.griddata((x1, y1), newarr.ravel(),
(xx, yy),
method=i)
meandifference = np.mean(np.abs(reference - GD1[3:6,3:6]))
print ' %s interpolation difference: %s' %(i,meandifference )
- :
linear interpolation difference: 4.88888888889
nearest interpolation difference: 4.11111111111
cubic interpolation difference: 5.99400137377
, , , . , , " " , .