radarx.retrieve.cloud_attenuation.gas_path_attenuation#

radarx.retrieve.cloud_attenuation.gas_path_attenuation(obj, profile, frequency=None, *, lwc=None, dbz=None, height=None, radar_height=None, n_threads=None, engine='auto')[source]#

Two-way gas (and cloud liquid) attenuation along the beam of a cloud radar.

The specific attenuation of oxygen and water vapour is computed with gas_specific_attenuation() at every level of the profile, interpolated linearly in height to the gates and integrated along the range from the radar with the trapezoid rule; the result is the two-way attenuation. The attenuation between the radar and the first gate uses the value of the first gate. With lwc the cloud liquid water of every gate is integrated in the same way with cloud_liquid_attenuation(), at the temperature of the profile.

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – A sweep or a time-height section with a range dimension (m), or a volume with sweep_* groups (sweeps without a field with a range are skipped). The gates are placed at the height given by height, else by a beam_height, height or z variable with a range dimension (the height above sea level of a vertically pointing radar), else by the 4/3 Earth model from the elevation (or zenith_angle) and the radar altitude.

  • profile (xarray.Dataset) – Sounding or model profile on a height coordinate (m above sea level, increasing) with pressure (Pa), temperature (K) and one of vapor_pressure (Pa), specific_humidity, dewpoint or relative_humidity, as the readers of radarx.io.sounding return. Gates above the profile get its top value.

  • frequency (float, optional) – Frequency in GHz. Default: the radar_frequency of the data (GHz, or Hz as xradar writes it).

  • lwc (str or xarray.DataArray, optional) – Liquid water content of the gates in g m-3 (a field of obj or a DataArray); NaN counts as 0. Adds PIA_CLOUD_LIQUID.

  • dbz (str or xarray.DataArray, optional) – The field whose gates define the output grid (for a Dataset). Default: the first of DBZH, DBZ, reflectivity, Z, Zh, else the first field with a range.

  • height (str or xarray.DataArray, optional) – Height of the gates in m above sea level (a DataArray with a range dimension, for example the beam_height of radarx.retrieve.beam_path()).

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

  • 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.Dataset or xarray.DataTree – On the gates of the field: PIA_OXYGEN, PIA_WATER_VAPOR, PIA_GAS (their sum) and, with lwc, PIA_CLOUD_LIQUID, the two-way attenuation in dB at the gate (add it to the reflectivity in dBZ). A volume gives a DataTree with the root of the input and one node per sweep. The input is not changed.

Raises:
  • ValueError – For a profile without pressure, temperature or humidity, gates without a height, a frequency outside 1 to 1000 GHz, an unknown engine or a range that does not increase.

  • TypeError – If profile is not a Dataset or lwc of the wrong type.

  • KeyError – If no sweep has a field with a range.

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

Notes

The gas attenuation of a vertically pointing radar below 3 km is about 0.3 dB at 35 GHz and 1.2 dB at 94 GHz, two-way; for a scanning radar at low elevation it grows with the path through the humid boundary layer. The sounding is the dominant uncertainty: take it near in time and place, or from a model.

References

Rec. ITU-R P.676-13, 2022: Attenuation by atmospheric gases and related effects. International Telecommunication Union, Geneva, https://www.itu.int/rec/R-REC-P.676 (recommendation, no DOI).

Rec. ITU-R P.840-9, 2023: Attenuation due to clouds and fog. International Telecommunication Union, Geneva, https://www.itu.int/rec/R-REC-P.840 (recommendation, no DOI).

Examples

>>> pia = gas_path_attenuation(sweep, sounding, frequency=94.0)
>>> dbz_corrected = sweep.DBZ + pia.PIA_GAS
>>> pia = sweep.radarx.gas_path_attenuation(sounding, lwc="LWC")