cupyx.scipy.interpolate.make_interp_spline#

cupyx.scipy.interpolate.make_interp_spline(x, y, k=3, t=None, bc_type=None, axis=0, check_finite=True)[source]#

Compute the (coefficients of) interpolating B-spline.

Parameters:
  • x (array_like, shape (n,)) – Abscissas.

  • y (array_like, shape (n, ...)) – Ordinates.

  • k (int, optional) – B-spline degree. Default is cubic, k = 3.

  • t (array_like, shape (nt + k + 1,), optional.) – Knots. The number of knots needs to agree with the number of data points and the number of derivatives at the edges. Specifically, nt - n must equal len(deriv_l) + len(deriv_r).

  • bc_type (2-tuple or None) –

    Boundary conditions. Default is None, which means choosing the boundary conditions automatically. Otherwise, it must be a length-two tuple where the first element (deriv_l) sets the boundary conditions at x[0] and the second element (deriv_r) sets the boundary conditions at x[-1]. Each of these must be an iterable of pairs (order, value) which gives the values of derivatives of specified orders at the given edge of the interpolation interval. Alternatively, the following string aliases are recognized:

    • "clamped": The first derivatives at the ends are zero. This is

      equivalent to bc_type=([(1, 0.0)], [(1, 0.0)]).

    • "natural": The second derivatives at ends are zero. This is equivalent to bc_type=([(2, 0.0)], [(2, 0.0)]).

    • "not-a-knot" (default): The first and second segments are the same polynomial. This is equivalent to having bc_type=None.

    • "periodic": The values and the first k-1 derivatives at the ends are equivalent.

  • axis (int, optional) – Interpolation axis. Default is 0.

  • check_finite (bool, optional) – Whether to check that the input arrays contain only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs. Default is True.

Returns:

b

Return type:

a BSpline object of the degree k and with knots t.