Ignoring NaN when interpolating grid in Python
Spline fitting/interpolation is global, so it's likely that even a single nan is messing up the whole mesh.
I have a gridded velocity field that I want to interpolate in Python. Currently I'm using scipy.interpolate's RectBivariateSpline to do this, but I want to be able to define edges of my field by setting certain values in the grid to NaN. However, when I do this it messes up the interpolation of the entire grid, effectively making it NaN everywhere. Apparently this is an error in the scipy fitpack, so what would be the best way to work around this? I want to be able to keep the NaNs in the grid to work with edges and out of bounds later on, but I don't want it to affect the interpolation in the rest of the grid.