repair_image_nonfinite

sunpy.image.coalignment.repair_image_nonfinite(image)[source] [edit on github]

Return a new image in which all the nonfinite entries of the original image have been replaced by the local mean.

Parameters

image (numpy.ndarray) – A two-dimensional numpy.ndarray.

Returns

numpy.ndarray – A two-dimensional numpy.ndarray of the same shape as the input that has all the non-finite entries replaced by a local mean. The algorithm repairs one non-finite entry at every pass. At each pass, the next non-finite value is replaced by the mean of its finite valued nearest neighbors.