pyinterp.bicubic(mesh: Grid2D | Grid3D | Grid4D, x: ndarray, y: ndarray, z: ndarray | None = None, u: ndarray | None = None, nx: int = 3, ny: int = 3, fitting_model: str = 'bicubic', boundary: str = 'undef', bounds_error: bool = False, num_threads: int = 0) 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.