API reference

This page provides an auto-generated summary of xr-scipy’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.

Top-level functions

gradient(f, coord[, edge_order])

Return the gradient of an xarray object.


integrate.trapz(obj, coord)

Integrate along the given coordinate using the composite trapezoidal rule.

integrate.simps(obj, coord[, even])

Integrate y(x) using samples along the given coordinate and the composite Simpson’s rule.

integrate.romb(obj, coord[, show])

Romberg integration using samples of a function.

integrate.cumtrapz(obj, coord)

Cumulatively integrate y(x) using the composite trapezoidal rule.


interpolate.interp1d(obj, coord[, kind, …])

Interpolate a 1-D function.

interpolate.PchipInterpolator(obj, coord[, …])

PCHIP 1-d monotonic cubic interpolation.

interpolate.Akima1DInterpolator(obj, coord)

Akima interpolator

interpolate.CubicSpline(obj, coord[, …])

Cubic spline data interpolator.

interpolate.LinearNDInterpolator(obj, *coords)

Piecewise linear interpolant in N dimensions.

interpolate.NearestNDInterpolator(obj, *coords)

Nearest-neighbour interpolation in N dimensions.

interpolate.CloughTocher2DInterpolator(obj, …)

Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D.

interpolate.RegularGridInterpolator(obj, *coords)

Interpolation on a regular grid in arbitrary dimensions

interpolate.griddata(obj, coords, …)

Wrapper for griddata.


fft.fft(a, coord[, n, norm])

Compute the one-dimensional discrete Fourier Transform.

fft.ifft(a, coord[, n, norm])

Compute the one-dimensional inverse discrete Fourier Transform.

fft.rfft(a, coord[, n, norm])

Compute the one-dimensional discrete Fourier Transform for real input.

fft.irfft(a, coord[, n, norm])

Compute the inverse of the n-point DFT for real input.

fft.fftn(a, *coords[, shape, norm])

Compute the N-dimensional discrete Fourier Transform.

fft.ifftn(a, *coords[, shape, norm])

Compute the N-dimensional inverse discrete Fourier Transform.

fft.rfftn(a, *coords[, shape, norm])

Compute the N-dimensional discrete Fourier Transform for real input.

fft.irfftn(a, *coords[, shape, norm])

Compute the inverse of the N-dimensional FFT of real input.

fft.hfft(a, coord[, n, norm])

Compute the FFT of a signal which has Hermitian symmetry (real spectrum).

fft.ihfft(a, coord[, n, norm])

Compute the inverse FFT of a signal which has Hermitian symmetry.


fftpack.fft(obj, coord[, n])

Return discrete Fourier transform of real or complex sequence.

fftpack.ifft(obj, coord[, n])

Return discrete inverse Fourier transform of real or complex sequence.

fftpack.rfft(obj, coord[, n])

Discrete Fourier transform of a real sequence.

fftpack.irfft(obj, coord[, n])

Return inverse discrete Fourier transform of real sequence x.

fftpack.dct(obj, coord[, type, n, norm])

Return the Discrete Cosine Transform of arbitrary type sequence x.

fftpack.idct(obj, coord[, type, n, norm])

Return the Inverse Discrete Cosine Transform of an arbitrary type sequence.

fftpack.dst(obj, coord[, type, n, norm])

Return the Discrete Sine Transform of arbitrary type sequence x.

fftpack.idst(obj, coord[, type, n, norm])

Return the Inverse Discrete Sine Transform of an arbitrary type sequence.

Spectral (FFT) analysis

signal.csd(darray, other_darray[, fs, …])

Estimate the cross power spectral density, Pxy, using Welch’s method.

signal.psd(darray[, fs, seglen, …])

Calculate the power spectral density.

signal.coherence(darray, other_darray[, fs, …])

Calculate the coherence as <CSD> / sqrt(<PSD1> * <PSD2>)

signal.xcorrelation(darray, other_darray[, …])

Calculate the crosscorrelation.

signal.crossspectrogram(darray, other_darray)

Calculate the cross spectrogram.

signal.spectrogram(darray[, fs, seglen, …])

Calculate the spectrogram using crossspectrogram applied to the same data

signal.coherogram(darray, other_darray[, …])

Calculate the coherogram

signal.hilbert(darray[, N, dim])

Compute the analytic signal, using the Hilbert transform.

Digital filters

signal.frequency_filter(darray, f_crit[, …])

Applies given frequency filter to a darray.

signal.lowpass(darray, f_cutoff, *args, **kwargs)

Applies lowpass filter to a darray.

signal.highpass(darray, f_cutoff, *args, …)

Applies highpass filter to a darray.

signal.bandpass(darray, f_low, f_high, …)

Applies bandpass filter to a darray.

signal.bandstop(darray, f_low, f_high, …)

Applies bandstop filter to a darray.

signal.decimate(darray[, q, target_fs, dim])

Decimate signal by given (int) factor or to closest possible target_fs along the specified dimension.

signal.savgol_filter(darray, window_length, …)

Apply a Savitzky-Golay filter to an array.