radarx.retrieve.vertical_profiles.qvp#

radarx.retrieve.vertical_profiles.qvp(obj, data_vars=None, *, sweep=None, elevation=None, min_rhohv=0.6, min_dbz=-10.0, rhohv='auto', dbz='auto', min_count=30, min_fraction=0.0, reduction='mean', linear=None, counts=False, elevation_correction=False, n_threads=None, engine='auto')[source]#

Quasi-vertical profile of one sweep.

Every range gate of a high-elevation PPI is reduced over all rays and assigned to its beam height (4/3 Earth model, as in xradar and radarx.grid.grid_cones()), using the median elevation of the sweep.

Parameters:
  • obj (xarray.DataTree or xarray.Dataset) – A radar volume with sweep_* groups (xradar layout) or a single sweep on (azimuth, range).

  • sweep (int or str, optional) – Sweep of a volume to use, by number or group name. By default the sweep with the highest elevation (Ryzhkov et al. 2016 [1] average at elevations exceeding 10°–20°, p. 552).

  • elevation (float, optional) – Use the sweep whose elevation is closest to this angle (degrees) instead.

  • data_vars (str or list of str, optional) – Variables to profile. By default the reflectivity, differential

    reflectivity, correlation coefficient and KDP that the sweep has (if it has none of them, every numeric (azimuth, range) variable). The mean of the radial velocity is not a wind and is left out; name a variable to profile it. The mean of a differential phase (named PHIDP, UPHIDP, … in degrees) is the circular mean.

    min_rhohvfloat or None, optional

    Only gates with rhohv > min_rhohv are used. Default 0.6 (Ryzhkov et al. 2016, p. 553). None disables the test.

    min_dbzfloat or None, optional

    Only gates with reflectivity > min_dbz are used. Default -10 dBZ (Ryzhkov et al. 2016, p. 553). None disables the test.

    rhohv, dbzstr or None, optional

    Names of the fields used for the two tests. "auto" (default) looks for common names (RHOHV, DBZH, …) and the CF standard name; a test is skipped if no field is found or the name is None.

    min_countint, optional

    Minimum number of valid gates on the circle for a defined value: the value is defined where the number of valid gates is at least min_count. Default 30. Ryzhkov et al. (2016, p. 553) require the number of valid gates to exceed 30, i.e. at least 31, so the default accepts one gate fewer than the paper; use min_count=31 for the paper’s rule.

    min_fractionfloat, optional

    Minimum fraction of the rays that must be valid. Default 0. The stricter of min_count and min_fraction applies.

    reduction{“mean”, “median”}, optional

    Azimuthal mean (default) or median.

    linearstr or list of str, optional

    Variables averaged in linear units (10**(x/10)) and converted back to dB. By default the variables with units dB, dBZ or dBm (reflectivity, differential reflectivity). Ignored for the median.

    countsbool, optional

    Also return <name>_count, the number of valid gates per height.

    elevation_correctionbool, optional

    Refer KDP and ZDR to the horizontal. KDP is divided by cos(elevation)**2, the factor by which its azimuthal mean at the elevation of the sweep is lower than at the horizontal (approximate scaling for small oblate scatterers; not checked against a paper). ZDR (dB) is corrected with the inverse of the relation used by radarx.retrieve.zdr_offset(), ZDR0 = ZDR + 20 log10(cos(e)**2) - 20 log10(1 - 10**(ZDR/20) sin(e)**2) for the elevation e: Rayleigh scattering by spheroids with a vertical axis and no canting. That formula is derived in radarx, not checked against a paper, and applied to the azimuthal mean of ZDR. Canted or tumbling particles (and ice with a horizontal-axis preference) do not follow it. Default False. Sweeps below 10 degrees raise a warning either way.

    n_threadsint, optional

    Threads for the compiled kernel. Default: all cores.

    engine{“auto”, “compiled”, “numpy”}, optional

    Implementation to use. "auto" (default) prefers the compiled kernel and falls back to NumPy.

Returns:

xarray.Dataset – Profiles on the height dimension (metres above sea level), with range and ground_range (radius of the averaging circle) as coordinates, the sweep time and elevation and the radar site. Variables keep their attributes; cell_methods records the reduction.

Notes

The filters (rhohv > 0.6, Z > -10 dBZ) are those of the initial QVP methodology of Ryzhkov et al. (2016) [1] (p. 553). The count rule differs by one gate (see min_count), and the heights of the gates are those of the 4/3 Earth model, not a statement of the paper. The diameter of the averaging circle grows with height (Ryzhkov et al. 2016, p. 553), whose radius is returned as ground_range. Azimuthal averaging at high elevation was suggested for the backscatter differential phase by Trömel et al. (2013) [2].

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 sweeps of a stack must have the same elevation and ranges; the heights are those of the median elevation.

References

Examples

>>> profile = radarx.retrieve.qvp(dtree, ["DBZH", "ZDR", "RHOHV"])
>>> profile = dtree.radarx.qvp(sweep=9)