gridfill
API
Fill missing values in a grid.
- gridfill.fill(grids, xdim, ydim, eps, relax=0.6, itermax=100, initzonal=False, cyclic=False, verbose=False)[source]
Fill missing values in grids with values derived by solving Poisson’s equation using a relaxation scheme.
Arguments:
- grid
A masked array with missing values to fill.
- xdim, ydim
The numbers of the dimensions in grid that represent the x-coordinate and y-coordinate respectively.
- eps
Tolerance for determining the solution complete.
Keyword arguments:
- relax
Relaxation constant. Usually 0.45 <= relax <= 0.6. Defaults to 0.6.
- itermax
Maximum number of iterations of the relaxation scheme. Defaults to 100 iterations.
- initzonal
If False missing values will be initialized to zero, if True missing values will be initialized to the zonal mean. Defaults to False.
- cyclic
Set to False if the x-coordinate of the grid is not cyclic, set to True if it is cyclic. Defaults to False.
- verbose
If True information about algorithm performance will be printed to stdout, if False nothing is printed. Defaults to False.
- gridfill.fill_cube(cube, eps, relax=0.6, itermax=100, initzonal=False, full_output=False, verbose=False, inplace=False)[source]
Fill missing values in a cube with values derived by solving Poisson’s equation using a relaxation scheme in the horizontal (i.e., x-y-) plane.
Arguments:
- cube
The iris.cube.Cube to be filled
- eps
Tolerance for determining the solution complete.
Keyword arguments:
- relax
Relaxation constant. Usually 0.45 <= relax <= 0.6. Defaults to 0.6.
- itermax
Maximum number of iterations of the relaxation scheme. Defaults to 100 iterations.
- initzonal
If False missing values will be initialized to zero, if True missing values will be initialized to the zonal mean. Defaults to False.
- full_output
If True this function returns a tuple (filled_cube, not_converged), where not_converged is a boolean array indicating slices where the algorithm did not converge. Defaults to False.
- verbose
If True information about algorithm performance will be printed to stdout, if False nothing is printed. Defaults to False.
- inplace
If True, modify cube.data in-place; if False, return a copy. Defaults to False.