pyinterp.bicubic(mesh: Union[pyinterp.grid.Grid2D, pyinterp.grid.Grid3D, pyinterp.grid.Grid4D], x: numpy.ndarray, y: numpy.ndarray, z: Optional[numpy.ndarray] = None, u: Optional[numpy.ndarray] = None, nx: Optional[int] = 3, ny: Optional[int] = 3, fitting_model: str = 'c_spline', boundary: str = 'undef', bounds_error: bool = False, num_threads: int = 0) numpy.ndarray[source]#

Bicubic gridded interpolator.

  • mesh

    Function on a uniform grid to be interpolated. If the grid is a grid in N-D space, the bicubic interpolation is performed spatially along the X and Y axes of the N-D grid and a linear interpolation are performed along the other axes between the values obtained by the bicubic interpolation.


    The GSL functions for calculating bicubic functions require that the axes defined in the grids are strictly increasing.

  • x – X-values.

  • y – Y-values.

  • z – None for a 2D Grid otherwise Z-values.

  • u – None for a 2D Grid, 3D Grid otherwise U-values.

  • nx – The number of X-coordinate values required to perform the interpolation. Defaults to 3.

  • ny – The number of Y-coordinate values required to perform the interpolation. Defaults to 3.

  • fitting_model – Type of interpolation to be performed. Supported are linear, bicubic, polynomial, c_spline, c_spline_periodic, akima, akima_periodic and steffen. Default to bicubic.

  • boundary

    A flag indicating how to handle boundaries of the frame.

    • expand: Expand the boundary as a constant.

    • wrap: circular boundary conditions.

    • sym: Symmetrical boundary conditions.

    • undef: Boundary violation is not defined.

    Default undef.

  • bounds_error – If True, when interpolated values are requested outside of the domain of the input axes (x,y), a ValueError is raised. If False, then the value is set to NaN. Default to False.

  • num_threads – The number of threads to use for the computation. If 0 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. Defaults to 0.


Values interpolated.