radarx.retrieve.qpe.rain_rate#

radarx.retrieve.qpe.rain_rate(obj, hid=None, *, band='S', class_relations=None, coefficients=None, dbz=None, zdr=None, kdp=None, a=None, temperature=None, polarization='h', z_cap=53.0, min_zdr=None, negative='keep', hid_kwargs=None, n_threads=None, engine='auto')[source]#

Rain rate with the relation chosen from the hydrometeor class of the gate.

Each gate gets the rain rate of the relation that radarx.retrieve.qpe assigns to its class (R(Z, ZDR) in rain and R(KDP) in a rain-hail mixture by default) and NaN where no relation is valid: hail, graupel, snow, ice crystals, the melting layer (wet snow) and gates without a class. RAIN_RATE_FLAG tells which. The classes are read from the attributes of the HID variable, so every method and band of radarx.retrieve.hid() works.

Parameters:
  • obj (xarray.Dataset or xarray.DataTree) – A sweep or grid with the fields of the relations that are used and, unless hid is given, the classes in HID; or a volume with sweep_* groups (sweeps without the fields are skipped). With the default relations the fields are the reflectivity, ZDR and KDP (a field is only needed if a class that occurs uses its relation).

  • hid (str, xarray.DataArray, xarray.Dataset or xarray.DataTree, optional) – The classification: the name of the field, the array, or the result of radarx.retrieve.hid() (for a volume, with the same sweep names). Default: HID of obj; if there is none, the classification is computed with radarx.retrieve.hid() (band and hid_kwargs).

  • band ({"S", "C", "X"}, optional) – Radar band, which selects the default coefficients (and the band of a classification that is computed here). Default "S".

  • class_relations (dict, optional) – Changes to the default of each class: a mapping from the name of a class (as in flag_meanings) to "z", "kdp", "z_zdr", "a", a pair (relation, factor) that scales the rain rate, or None for no estimate. For example {"wet_snow": ("z", 0.6)} adds the wet-snow estimate of Giangrande and Ryzhkov (2007) and {"heavy_rain": "kdp"} takes R(KDP) in heavy rain. A name that is not a class of the classification raises an error.

  • coefficients (dict, optional) – Coefficients by relation, {"z": (a, b), "kdp": (a, b), "z_zdr": (a, b, c), "a": (a, b)}, instead of the defaults of the band; required for a relation that has none at that band.

  • dbz, zdr, kdp, a (str or xarray.DataArray, optional) – Names of the fields, or the fields. By default the names of rain_rate_z(), rain_rate_z_zdr(), rain_rate_kdp() and rain_rate_a().

  • temperature, polarization (optional) – For R(A) only, see rain_rate_a().

  • z_cap, min_zdr, negative (optional) – See rain_rate_z(), rain_rate_z_zdr() and rain_rate_kdp().

  • hid_kwargs (dict, optional) – Options of radarx.retrieve.hid() for a classification computed here, for example {"temperature": profile}.

  • n_threads, engine (optional) – See rain_rate_z().

Returns:

xarray.Dataset or xarray.DataTree – RAIN_RATE (mm h-1, float32), RAIN_RATE_FLAG (0 estimated, 1 no relation for the class, 2 an input is missing, 3 not classified) and RAIN_RATE_RELATION (0 none, 1 R(Z), 2 R(KDP), 3 R(Z,ZDR), 4 R(A)), on the coordinates of the fields; for a DataTree one node per sweep. The input is not changed.

Raises:
  • KeyError – If a field that a used relation needs, or a sweep that has all of them, is not found.

  • ValueError – For an unknown option, a class name that does not exist, or a relation without a default at band and without coefficients.

Notes

The default relations are those of Giangrande and Ryzhkov (2007) at S band, and the T-matrix relations of Bringi and Chandrasekar (2001) for "z_zdr" and "kdp" at C band, so the blend works at S, C and X band. There is no C-band "z". Pass coefficients for the relations of your radar, or choose with class_relations relations that have a default. The factors fitted to gauges for wet snow, graupel, dry snow and crystals in that paper are for Oklahoma and are not applied unless you ask for them.

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

Giangrande, S. E., and A. V. Ryzhkov, 2008: Estimation of rainfall based on the results of polarimetric echo classification. J. Appl. Meteor. Climatol., 47 (9), 2445-2462, https://doi.org/10.1175/2008JAMC1753.1 (the class table is taken from the extended abstract of the same title, 33rd Conf. on Radar Meteorology, 2007, paper P6B.7, Eq. 4; the journal article has not been compared).

Bringi, V. N., and V. Chandrasekar, 2001: Polarimetric Doppler Weather Radar: Principles and Applications. Cambridge University Press, https://doi.org/10.1017/CBO9780511541094 (Table 8.1 and Eq. 8.14, the C-band defaults of the blend; reproduced with the T-matrix code of radarx in the notebook TMatrix_Textbook_Examples).

Ryzhkov, A. V., S. E. Giangrande, and T. J. Schuur, 2005: Rainfall estimation with a polarimetric prototype of WSR-88D. J. Appl. Meteor., 44 (4), 502-515, https://doi.org/10.1175/JAM2213.1

Ryzhkov, A., M. Diederich, P. Zhang, and C. Simmer, 2014: Potential utilization of specific attenuation for rainfall estimation, mitigation of partial beam blockage, and radar networking. J. Atmos. Oceanic Technol., 31 (3), 599-619, https://doi.org/10.1175/JTECH-D-13-00038.1 (R(A) relations)

Examples

>>> volume = volume.radarx.assign(volume.radarx.hid(profile))
>>> rr = radarx.retrieve.rain_rate(volume)
>>> rr = sweep.radarx.rain_rate(class_relations={"wet_snow": ("z", 0.6)})