radarx.retrieve.cloud_classification.classify_cloud_targets#

radarx.retrieve.cloud_classification.classify_cloud_targets(obj, temperature=None, *, dbz=None, ldr=None, dfr=None, height=None, radar_height=None, melting_temperature=(0.0, 2.0), min_dbz=None, min_drizzle_dbz=-20.0, min_insect_ldr=-20.0, max_insect_dbz=10.0, min_large_dfr=3.0, n_threads=None, engine='auto')[source]#

Classify the echoes of a cloud radar into droplets, drizzle or rain, ice, melting ice and insects.

See radarx.retrieve.cloud_classification for the classes and the rules.

Parameters:
  • obj (xarray.DataArray, xarray.Dataset or xarray.DataTree) – The reflectivity (DataArray), a sweep or time-height section with it, or a volume with sweep_* groups (sweeps without a reflectivity are skipped).

  • temperature (str, float, xarray.DataArray or xarray.Dataset, optional) – Air temperature of the gates: the name of a field (temperature, air_temperature or T by default), a DataArray on the gates, a profile Dataset on a height coordinate (m above sea level) with temperature (interpolated to the heights of the gates, see height), or a number (a constant temperature). Kelvin, or degrees Celsius if the units attribute says so (without units, values below 150 are Celsius). Use the wet-bulb temperature to place the melting layer as Cloudnet does.

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

  • ldr (str or xarray.DataArray, optional) – Linear depolarization ratio in dB, to find insects. Default None: no insect class.

  • dfr (str or xarray.DataArray, optional) – Dual-frequency ratio in dB (radarx.retrieve.dual_frequency_ratio()) to tell large ice from ice. Default None: no large-ice class.

  • height (str or xarray.DataArray, optional) – Height of the gates in m above sea level (a DataArray with a range dimension), for a temperature profile. Default: the beam_height, height or z of the data, else the 4/3 Earth model from the elevation (or zenith_angle).

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

  • melting_temperature (tuple of float, optional) – Lower and upper bound in degrees Celsius of the melting zone. Default (0.0, 2.0).

  • min_dbz (float, optional) – Smallest reflectivity (dBZ) of an echo. Default None: every finite value.

  • min_drizzle_dbz (float, optional) – Smallest reflectivity (dBZ) of drizzle or rain. Default -20.

  • min_insect_ldr (float, optional) – Smallest depolarization ratio (dB) of insects; None turns the insect rule off. Default -20.

  • max_insect_dbz (float, optional) – Largest reflectivity (dBZ) of insects. Default 10.

  • min_large_dfr (float, optional) – Smallest dual-frequency ratio (dB) of large ice; None turns the rule off. Default 3.

  • 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 – TARGET_CLASS (int8, codes in the table of the module and in the flag_values and flag_meanings attributes) on the gates of the reflectivity. A volume gives a DataTree with the root of the input and one node per sweep.

Raises:
  • ValueError – For an unknown engine, a melting zone that is not an increasing pair, or a profile without height.

  • KeyError – If the reflectivity or the temperature is not found.

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

References

Illingworth, A. J., et al., 2007: Cloudnet: Continuous evaluation of cloud profiles in seven operational models using ground-based observations. Bull. Amer. Meteor. Soc., 88, 883-898, https://doi.org/10.1175/BAMS-88-6-883

Tukiainen, S., E. O’Connor, and A. Korpinen, 2020: CloudnetPy: A Python package for processing cloud remote sensing data. J. Open Source Softw., 5, 2123, https://doi.org/10.21105/joss.02123

Examples

>>> cls = classify_cloud_targets(section, "temperature", ldr="ldr")
>>> cls = section.radarx.classify_cloud_targets(model_profile, dfr=dfr)