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. Withlwcthe cloud liquid water of every gate is integrated in the same way withcloud_liquid_attenuation(), at the temperature of the profile.- Parameters:
obj (
xarray.DataArray,xarray.Datasetorxarray.DataTree) – A sweep or a time-height section with arangedimension (m), or a volume withsweep_*groups (sweeps without a field with a range are skipped). The gates are placed at the height given byheight, else by abeam_height,heightorzvariable with arangedimension (the height above sea level of a vertically pointing radar), else by the 4/3 Earth model from theelevation(orzenith_angle) and the radar altitude.profile (
xarray.Dataset) – Sounding or model profile on aheightcoordinate (m above sea level, increasing) withpressure(Pa),temperature(K) and one ofvapor_pressure(Pa),specific_humidity,dewpointorrelative_humidity, as the readers ofradarx.io.soundingreturn. Gates above the profile get its top value.frequency (
float, optional) – Frequency in GHz. Default: theradar_frequencyof the data (GHz, or Hz as xradar writes it).lwc (
strorxarray.DataArray, optional) – Liquid water content of the gates in g m-3 (a field ofobjor a DataArray); NaN counts as 0. AddsPIA_CLOUD_LIQUID.dbz (
strorxarray.DataArray, optional) – The field whose gates define the output grid (for aDataset). Default: the first ofDBZH,DBZ,reflectivity,Z,Zh, else the first field with a range.height (
strorxarray.DataArray, optional) – Height of the gates in m above sea level (a DataArray with arangedimension, for example thebeam_heightofradarx.retrieve.beam_path()).radar_height (
float, optional) – Radar altitude in m above sea level for the 4/3 Earth model. Default: thealtitudeof 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.Datasetorxarray.DataTree– On the gates of the field:PIA_OXYGEN,PIA_WATER_VAPOR,PIA_GAS(their sum) and, withlwc,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
engineor a range that does not increase.TypeError – If
profileis not a Dataset orlwcof 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")