I have some curvilinear gridded data, and I'm trying to interpolate this data to a new grid. The data has unrealistically high variables for the masked data, so I tried masking using:
temp = np.ma.masked_where(temp > 500, temp)
if I do this then:
>>> temp.max()
28.174417
However, when I run:
temp = RectBivariateSpline(lon, lat,
np.swapaxes(temp, 0, 1))
temp = temp.ev(newgrid_lon, newgrid_lat)
I end up with the unrealistically high mask values again:
>>> temp.max()
1.541312613999187e+30
scipy.interpolate
is obviously not accepting my mask. Does anyone know how to set a mask for scipy.interpolate
or know any workarounds? Thanks.