radarx.level1.spectra.doppler_spectra#

radarx.level1.spectra.doppler_spectra(obj, iq=None, *, dim='pulse', window='hann', segments=1, wavelength=None, prt=None, n_threads=None, engine='auto')[source]#

Doppler power spectra of IQ time series.

The windowed periodogram of the pulses of every gate on the velocity axis (positive away from the radar), normalised so that the bins add up to the mean power; see radarx.level1.spectra.

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – The complex IQ samples with a pulse dimension (a DataArray), a sweep that holds them, or a volume (sweep by sweep; sweeps without IQ are skipped).

  • iq (str, optional) – Name of the IQ variable of a sweep. By default the first of IQ, iq, IQH and IQV.

  • dim (str, optional) – The pulse (slow time) dimension. Default "pulse".

  • window ({"hann", "rect", "hamming", "blackman"}, optional) – Window of the periodogram. Default "hann" (radarx choice; the von Hann window is the one of Doviak and Zrnic 1993, Fig. 7.31).

  • segments (int, optional) – Number of consecutive blocks of M // segments pulses whose periodograms are averaged. The pulses after the last full block are not used. Default 1.

  • wavelength (float, optional) – Radar wavelength (m). By default the wavelength attribute of the IQ array, or the sweep’s wavelength or radar_frequency.

  • prt (float, optional) – Pulse repetition time (s). By default the prt attribute or variable.

  • n_threads (int, optional) – Threads for the compiled kernel. Default: all cores.

  • engine ({"auto", "compiled", "numpy"}, optional) – Implementation to use. "auto" prefers the compiled kernel and falls back to NumPy.

Returns:

xarray.Dataset or xarray.DataTree – SPECTRUM, the power per bin in the squared units of the samples, with the dimensions of the IQ array without the pulse dimension and a velocity dimension (ascending, m s-1, bin L // 2 is zero). The attributes hold wavelength, prt, nyquist_velocity, window, n_average (segments) and window_variance_bins2, which the other functions read.

Raises:
  • KeyError – If a sweep has no IQ variable (a volume where no sweep has one).

  • ValueError – If the samples are not complex, the pulse dimension is missing, there are fewer than 3 pulses per segment, or the wavelength or pulse repetition time is not known.

  • ImportError – If engine="compiled" and the compiled kernels are not available.

Notes

The radar moments are estimated from the spectra with spectral_moments(). Strong ground clutter leaks into the bins around zero velocity through the window; a window with lower sidelobes ("blackman") lowers the leakage.

References

Harris, F., 1978: On the use of windows for harmonic analysis with the discrete Fourier transform. Proc. IEEE, 66 (1), 51-83, https://doi.org/10.1109/PROC.1978.10837

Bluestein, L., 1970: A linear filtering approach to the computation of discrete Fourier transform. IEEE Trans. Audio Electroacoust., 18 (4), 451-455, https://doi.org/10.1109/TAU.1970.1162132

Doviak, R. J., and D. S. Zrnic, 1993: Doppler Radar and Weather Observations, 2nd ed. Academic Press (Chapters 5 and 6).

Examples

>>> spectra = radarx.level1.doppler_spectra(iq, window="blackman")