radarx.retrieve.calibration.zdr_offset#

radarx.retrieve.calibration.zdr_offset(obj, method='light_rain', *, zdr=None, dbz=None, rhohv=None, snr=None, mask=None, elevation=None, reference=None, z_range=None, min_rhohv=0.98, min_snr=None, statistic='median', min_count=100, dim=None, band=None, temperature=20.0, n_threads=None, engine='auto')[source]#

Offset of the differential reflectivity from vertical pointing, light rain or dry snow.

The offset is the median (or mean) of ZDR - reference over the gates that pass the selection (rhohv at least min_rhohv, reflectivity within z_range, SNR at least min_snr, mask true). The offset is the measured value minus the true one, so ZDR - offset is the corrected differential reflectivity. See radarx.retrieve.calibration for the three methods, the reference values, the elevation dependence and the radarx choices.

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – ZDR (DataArray), a sweep, a quasi-vertical profile (with the dimension height) or a volume (sweep by sweep).

  • method ({"light_rain", "vertical", "dry_snow"}, optional) – Natural target, default "light_rain".

  • zdr, dbz, rhohv, snr (str or xarray.DataArray, optional) – Fields (names in a Dataset, or arrays). dbz is needed for the reflectivity limits and for "light_rain"; rhohv and snr are used when given, rhohv also when found under its default name. Defaults: ZDR, DBZH, RHOHV.

  • mask (xarray.DataArray, optional) – Boolean array that selects the gates (for example the rain below the melting layer, or the snow above it). It is required in practice for "dry_snow".

  • elevation (float or xarray.DataArray, optional) – Elevation angle in degrees. By default the elevation variable of the sweep; with none the elevation dependence is not applied.

  • reference (float, optional) – Intrinsic ZDR (dB) at 0 degrees elevation of the target. Default: 0 for "vertical", 0.2 for "dry_snow", and for "light_rain" the Marshall-Palmer value at the reflectivity of each gate. A number replaces it with a constant.

  • z_range (tuple of float, optional) – Reflectivity limits (dBZ) of the target. Default: no limits for "vertical", (20, 25) for "light_rain" and (0, 30) for "dry_snow" (radarx choices).

  • min_rhohv (float, optional) – Smallest correlation coefficient. Default 0.98.

  • min_snr (float, optional) – Smallest SNR in dB; the SNR field is only used with this.

  • statistic ({"median", "mean"}, optional) – The statistic that is reported as the offset. Default "median", which is robust to the outliers that remain in a selection.

  • min_count (int, optional) – Fewest gates for an offset; NaN below it. Default 100.

  • dim (str or sequence of str, optional) – Dimensions to reduce. Default: the rays and range of a sweep, the height of a profile, else all. A quasi-vertical profile with time gives one offset per time.

  • band ({"S", "C", "X"}, optional) – Radar band for the "light_rain" reference. Default: from the data.

  • temperature (float, optional) – Temperature (degrees Celsius) of the scattering tables. Default 20.

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

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

Returns:

xarray.Dataset or xarray.DataTree – ZDR_OFFSET (dB), ZDR_OFFSET_MEAN, ZDR_OFFSET_MEDIAN, ZDR_OFFSET_STD (the spread of the selected gates), ZDR_OFFSET_SE (the standard error of the mean) and ZDR_OFFSET_COUNT (gates), with the dimensions that were not reduced; a DataTree with one node per sweep for a volume.

Raises:
  • KeyError – If a field is not found.

  • ValueError – For unknown options or a missing reflectivity.

  • ImportError – If engine="compiled" and the compiled kernel is not available.

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).

References

Ryzhkov, A. V., S. E. Giangrande, V. M. Melnikov, and T. J. Schuur, 2005: Calibration issues of dual-polarization radar measurements. J. Atmos. Oceanic Technol., 22 (8), 1138-1155, https://doi.org/10.1175/JTECH1772.1 (the use of vertical pointing, light rain and dry aggregated snow, and the adaptation to other elevations; their reference values and selection limits are not reproduced, see above).

Marshall, J. S., and W. McK. Palmer, 1948: The distribution of raindrops with size. J. Meteor., 5 (4), 165-166, https://doi.org/10.1175/1520-0469(1948)005<0165:TDORWS>2.0.CO;2

Examples

>>> off = radarx.retrieve.zdr_offset(sweep)
>>> off = dtree.radarx.zdr_offset("light_rain", min_snr=15)
>>> corrected = sweep.ZDR - float(off.ZDR_OFFSET)