pyinterp.core.fill.fft_inpaint_float32

pyinterp.core.fill.fft_inpaint_float32#

pyinterp.core.fill.fft_inpaint_float32(grid: typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]", "flags.writeable", "flags.c_contiguous"], first_guess: pyinterp.core.fill.FirstGuess = <FirstGuess.ZonalAverage: 1>, is_circle: bool = True, max_iterations: typing.SupportsInt = 500, epsilon: typing.SupportsFloat = 0.0001, sigma: typing.SupportsFloat = 10.0, num_threads: typing.SupportsInt = 0) tuple[int, float]#

Replace all undefined values (NaN) in a grid using spectral in-painting.

Parameters:
  • grid – The grid to be processed

  • first_guess – Method to use for the first guess.

  • is_circle – If true, uses a Fast Fourier Transform (FFT) assuming periodic boundaries. If false, uses a Discrete Cosine Transform (DCT) assuming reflective boundaries.

  • max_iterations – Maximum number of iterations.

  • epsilon – Tolerance for ending relaxation.

  • sigma – Standard deviation of the Gaussian low-pass filter in pixel units. Controls the smoothness of the fill.

  • num_threads – The number of threads to use for the computation.

Returns:

A tuple containing the number of iterations performed and the maximum residual value.