radarx.retrieve.cloud_attenuation.rain_path_attenuation#

radarx.retrieve.cloud_attenuation.rain_path_attenuation(obj, frequency=None, *, dbz=None, temperature=10.0, a=None, b=None, mask=None, melting=None, height=None, radar_height=None, max_pia=10.0, n_threads=None, engine='auto')[source]#

Two-way rain attenuation along the beam by the Hitschfeld and Bordan solution.

With the relation k = a Z**b of rain_attenuation_relation() the solution of Hitschfeld and Bordan (1954), radarx.fundamentals.reflectivity.hitschfeld_bordan_correction(), gives the path-integrated attenuation at every gate from the measured reflectivity alone. Only gates of rain count: gates that are not in mask or are at or above melting add nothing, and gates behind the rain carry the attenuation of the whole rain path (the attenuation does not decrease).

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – The measured (attenuated) reflectivity in dBZ on a range dimension, a dataset with it, or a volume. Correct the gas attenuation first if it matters.

  • frequency (float, optional) – Frequency in GHz. Default: the radar_frequency of the data.

  • dbz (str or xarray.DataArray, optional) – The reflectivity. Default: obj itself for a DataArray, else the first of DBZH, DBZ, reflectivity, Z, Zh.

  • temperature (float, optional) – Temperature of the rain in degrees Celsius for the relation. Default 10.

  • a, b (float, optional) – Coefficients of k = a Z**b to use instead of the fit.

  • mask (str or xarray.DataArray, optional) – True for the gates that can hold rain.

  • melting (float, optional) – Height in m above sea level of the melting level; gates at or above it do not count. Needs the gate heights (see height).

  • height (str or xarray.DataArray, optional) – Height of the gates in m above sea level, as for gas_path_attenuation().

  • radar_height (float, optional) – Radar altitude in m above sea level for the 4/3 Earth model.

  • max_pia (float, optional) – Largest two-way attenuation in dB that the solution may reach (it is unstable beyond). Default 10.

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

  • engine ({"auto", "compiled", "numpy"}, optional) – Implementation. "auto" (default) prefers the compiled kernel.

Returns:

xarray.DataArray or xarray.DataTree – PIA_RAIN (dB, two-way) on the gates of the reflectivity; 0 before the first rain gate. A volume gives a DataTree with the root of the input and one node per sweep.

Raises:
  • ValueError – For a frequency outside 1 to 1000 GHz, an unknown engine or melting without gate heights.

  • KeyError – If no reflectivity is found.

References

Hitschfeld, W., and J. Bordan, 1954: Errors inherent in the radar measurement of rainfall at attenuating wavelengths. J. Meteor., 11 (1), 58-67, https://doi.org/10.1175/1520-0469(1954)011<0058:EIITRM>2.0.CO;2

Examples

>>> pia = rain_path_attenuation(sweep, 35.0, melting=3000.0)
>>> dbz_corrected = sweep.DBZ + pia