radarx.level1.iq.simulate_iq#

radarx.level1.iq.simulate_iq(velocity, width=1.0, power=1.0, *, noise=0.0, clutter_power=0.0, clutter_width=0.3, n_pulses=64, wavelength=0.1, prt=0.001, dims=None, seed=None)[source]#

Simulate IQ time series with a Gaussian Doppler spectrum of known moments.

Every gate gets a complex Gaussian series whose power spectrum is a Gaussian of mean velocity velocity and standard deviation width, folded into the Nyquist interval, plus white noise and optionally ground clutter, a second Gaussian at zero velocity. The method is that of Zrnic (1975): the amplitudes of the DFT bins are the square root of the power spectrum times complex Gaussian numbers, and the series is the inverse DFT. The signal power of a gate is power on average, so the moments of the simulated series are known (the mean power, the velocity and the width that pulse_pair_moments() and spectral_moments() should find, with the sampling error of the dwell).

Parameters:
  • velocity (float, array_like or xarray.DataArray) – Mean radial velocity (m s-1), positive away from the radar. Values outside the Nyquist interval are aliased by the sampling, as in a radar. An array gives one series per element.

  • width (float, array_like or xarray.DataArray, optional) – Spectrum width, the standard deviation of the velocity spectrum (m s-1). Widths below a tenth of a spectral bin are raised to that value. Default 1.

  • power (float, array_like or xarray.DataArray, optional) – Signal power, in the squared units of the samples. Default 1.

  • noise (float, array_like or xarray.DataArray, optional) – Power of the white receiver noise per sample. Default 0.

  • clutter_power (float, array_like or xarray.DataArray, optional) – Power of the ground clutter (zero mean velocity). Default 0.

  • clutter_width (float, optional) – Spectrum width of the clutter (m s-1). Default 0.3.

  • n_pulses (int, optional) – Pulses per series. Default 64.

  • wavelength (float, optional) – Radar wavelength (m). Default 0.1 (S band).

  • prt (float, optional) – Pulse repetition time (s). Default 1e-3. The Nyquist velocity is wavelength / (4 prt).

  • dims (sequence of str, optional) – Dimension names of NumPy parameters of 1 or 2 axes; the defaults are ("range",) and ("azimuth", "range"). DataArray parameters bring their own.

  • seed (int or numpy.random.Generator, optional) – Seed of the random numbers.

Returns:

xarray.DataArray – Complex complex64 samples with the dimensions of the parameters and a pulse dimension (before range if there is one), named IQ, with the wavelength and prt attributes. This function runs in NumPy only: it generates test data and is not a processing step.

Raises:

ValueError – If n_pulses is below 3, the wavelength or the pulse repetition time is not positive, a power is negative, or a NumPy parameter needs dims.

References

Zrnić, D. S., 1975: Simulation of weatherlike Doppler spectra and signals. J. Appl. Meteor., 14 (4), 619-620, https://doi.org/10.1175/1520-0450(1975)014<0619:SOWDSA>2.0.CO;2

Examples

>>> iq = radarx.level1.simulate_iq(
...     velocity=[5.0, -8.0], width=1.5, power=100.0, noise=1.0, seed=1
... )