pysteps.utils.spectral.rapsd(field, fft_method=None, return_freq=False, d=1.0, normalize=False, **fft_kwargs)#

Compute radially averaged power spectral density (RAPSD) from the given 2D input field.

  • field (array_like) – A 2d array of shape (m, n) containing the input field.

  • fft_method (object) – A module or object implementing the same methods as numpy.fft and scipy.fftpack. If set to None, field is assumed to represent the shifted discrete Fourier transform of the input field, where the origin is at the center of the array (see numpy.fft.fftshift or scipy.fftpack.fftshift).

  • return_freq (bool) – Whether to also return the Fourier frequencies.

  • d (scalar) – Sample spacing (inverse of the sampling rate). Defaults to 1. Applicable if return_freq is ‘True’.

  • normalize (bool) – If True, normalize the power spectrum so that it sums to one.


  • out (ndarray) – One-dimensional array containing the RAPSD. The length of the array is int(l/2) (if l is even) or int(l/2)+1 (if l is odd), where l=max(m,n).

  • freq (ndarray) – One-dimensional array containing the Fourier frequencies.