pyinterp.core.fill.multigrid_float32

pyinterp.core.fill.multigrid_float32#

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

Replace all undefined values (NaN) in a grid using multigrid method.

Parameters:
  • grid – The grid to be processed

  • first_guess – Method to use for the first guess.

  • is_circle – If true, uses periodic boundaries along the X-axis. If false, uses reflective boundaries.

  • max_iterations – Maximum number of iterations.

  • epsilon – Tolerance for ending relaxation.

  • pre_smooth – Number of pre-smoothing iterations per level (default: 2).

  • post_smooth – Number of post-smoothing iterations per level (default: 2).

  • 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.