I am using ndimage to interpolate as follows:
ndimage.map_coordinates(input_data, coords, output, 2, prefilter=False)
Now, the problem is that I do not have valid measurements over my whole input data. So, I have a masked array which tells me which data points are valid. So, when doing the interpolation, I would like to only use pixels which are valid and also adjust the weightings accordingly (to ensure that the weights sum to 1).
However, I see that there is no easy way to do this. I was wondering if someone knows of a good way to do this or can point me to some library or code that I can use. I am coming from a C++ background, so still finding my way around python.