pysteps.utils.spectral.rapsd

pysteps.utils.spectral.rapsd(Z, 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.

Parameters
Z: 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, Z 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.

Returns
out: ndarray

One-dimensional array containing the RAPSD. The length of the array is int(L/2)+1 (if L is even) or int(L/2) (if L is odd), where L=max(M,N).

freq: ndarray

One-dimensional array containing the Fourier frequencies.

References

[RC11]