interpolate_replace_nans¶
- astropy.convolution.interpolate_replace_nans(array, kernel, convolve=<function convolve>, **kwargs)[source]¶
Given a data set containing NaNs, replace the NaNs by interpolating from neighboring data points with a given kernel.
- Parameters:
- array
numpy.ndarray Array to be convolved with
kernel. It can be of any dimensionality, though only 1, 2, and 3d arrays have been tested.- kernel
numpy.ndarrayorastropy.convolution.Kernel The convolution kernel. The number of dimensions should match those for the array. The dimensions do not have to be odd in all directions, unlike in the non-fft
convolvefunction. The kernel will be normalized ifnormalize_kernelis set. It is assumed to be centered (i.e., shifts may result if your kernel is asymmetric). The kernel must be normalizable (i.e., its sum cannot be zero).- convolve
convolveorconvolve_fft One of the two convolution functions defined in this package.
- array
- Returns:
- newarray
numpy.ndarray A copy of the original array with NaN pixels replaced with their interpolated counterparts
- newarray