radarx.retrieve.noise.snr#

radarx.retrieve.noise.snr(obj, noise=None, dbz=None, *, signal_includes_noise=False, noise_options=None, n_threads=None, engine='auto')[source]#

Signal-to-noise ratio of every gate from the reflectivity.

SNR = Z - Z_N - 20 log10(r / km) in dB, with the noise level \(Z_N\) (dBZ at 1 km) of noise_level(). See radarx.retrieve.noise.

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – The reflectivity (DataArray), a sweep or a volume.

  • noise (float, xarray.DataArray, xarray.Dataset or xarray.DataTree, optional) – Noise level (dBZ at 1 km): a number, an array that broadcasts against the reflectivity (for example one value per ray), the result of noise_level() (a DataTree for a volume). By default it is estimated from the reflectivity itself with noise_options.

  • dbz (str, optional) – Name of the reflectivity, see noise_level().

  • signal_includes_noise (bool, optional) – The reflectivity still contains the noise power (no noise subtraction). Gates where it is not above the noise are NaN. Default False.

  • noise_options (dict, optional) – Options of noise_level() when the noise is estimated (method, by, n_samples, …).

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

  • engine ({"auto", "compiled", "numpy"}, optional) – Implementation to use.

Returns:

xarray.DataArray or xarray.DataTree – SNR (dB) on the coordinates of the reflectivity, float32; for a volume a DataTree with one node per sweep. Dask arrays stay lazy.

Raises:

Notes

Dask and extra dimensions. The fields may have extra leading dimensions (for example time or volume): each sweep is processed on its own and the result has the same extra dimensions. Dask arrays stay lazy: the result is a dask array and nothing is computed until it is (the sweep dimensions are rechunked into one chunk). The attribute noise_level is written for a sweep in memory only.

References

Doviak, R. J., and D. S. Zrnic, 1993: Doppler Radar and Weather Observations, 2nd ed. Academic Press (SNR of a weather echo and the equivalent reflectivity of the noise; not checked against the book).

Hildebrand, P. H., and R. S. Sekhon, 1974: Objective determination of the noise level in Doppler spectra. J. Appl. Meteor., 13 (7), 808-811, https://doi.org/10.1175/1520-0450(1974)013<0808:ODOTNL>2.0.CO;2 (the default noise level).

Examples

>>> s = radarx.retrieve.snr(sweep, noise=-40.0)
>>> s = dtree.radarx.snr()