interpax_fft.rfft_interp2d

interpax_fft.rfft_interp2d(f: Num[Array, 'nx ny ...'] | Num[ndarray, 'nx ny ...'] | Num[TypedNdArray, 'nx ny ...'], n1: int, n2: int, sx: Num[Array, 's'] | Num[ndarray, 's'] | Num[TypedNdArray, 's'] | None = None, sy: Num[Array, 's'] | Num[ndarray, 's'] | Num[TypedNdArray, 's'] | None = None, dx: float = 1.0, dy: float = 1.0) Inexact[Array, 'n1 n2 ... s']Source

Interpolation of a real-valued 2D periodic function via FFT.

Parameters:
  • f (ndarray, shape(nx, ny, ...)) – Source data. Assumed to cover 1 full period, excluding the endpoint.

  • n1 (int) – Number of desired interpolation points in x and y directions.

  • n2 (int) – Number of desired interpolation points in x and y directions.

  • sx (ndarray or None) – Shift in x and y to evaluate at. If original data is f(x,y), interpolates to f(x + sx, y + sy). Both must be provided or None.

  • sy (ndarray or None) – Shift in x and y to evaluate at. If original data is f(x,y), interpolates to f(x + sx, y + sy). Both must be provided or None.

  • dx (float) – Spacing of source points in x and y.

  • dy (float) – Spacing of source points in x and y.

Returns:

fi (ndarray, shape(n1, n2, …, len(sx))) – Interpolated (and possibly shifted) data points.