radarx.retrieve.rain_bulk.rain_shaft_bulk#

radarx.retrieve.rain_bulk.rain_shaft_bulk(rain, *, depth, density_correction=True, profile=None, top_height=None, step=10.0, cfl=0.25, n_threads=None, engine='auto')[source]#

Number and water content of rain below the top of a shaft, two-moment.

Evolves the number concentration and the rainwater content of a column of still air with self-collection and breakup; the equations, the choices of radarx and the limits are in radarx.retrieve.rain_bulk.

Parameters:
  • rain (xarray.Dataset) – number_concentration (m-3) and liquid_water_content (g m-3) at the top of the shaft, on any common dimensions (every point is one column, for example the gates of a sweep, the points of a grid or the times of a disdrometer). This is the form of the output of radarx.retrieve.rain_shaft(). Not changed. A dask-backed input gives a lazy result.

  • depth (float or array-like) – Distance (m) below the top where the rain is wanted: one value (a scalar depth coordinate) or an ascending series (not negative), the depth dimension.

  • density_correction (bool, optional) – Multiply the fall speeds and the collision rate by \((\rho_0/\rho)^{0.4}\). Default True; without profile and top_height the air is at the sea-level density.

  • profile (xarray.Dataset, optional) – Profile on height (m above sea level) with air_density or pressure and temperature (and specific_humidity), see radarx.io.sounding. It must cover the shaft. Not changed.

  • top_height (float, optional) – Height (m above sea level) of the top of the shaft; required with profile.

  • step (float, optional) – Longest step of the integration (m). Default 10.

  • cfl (float, optional) – Longest step as a share of the distance over which the collisions change the number of drops. Default 0.25.

  • 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 – On the dimensions of rain with depth (if a series was given) last: number_concentration (m-3), liquid_water_content (g m-3), mean_volume_diameter (mm), shape_parameter, slope_parameter (mm-1) and rain_rate (mm h-1, which does not change with the depth). Columns with a NaN, a value that is not positive or a mean volume diameter at the top outside 0.05 to 25 mm give NaN.

Raises:
  • ValueError – For a missing variable, a negative or descending depth, an unknown engine or a profile that does not cover the shaft.

  • TypeError – If rain is not a Dataset.

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

Notes

Source: Seifert (2008), see the module documentation for the equations, the interpreted sign of Eq. (A12) and the limits.

Dask. Dask arrays stay lazy: the result is a dask array and nothing is computed until it is.

References

Examples

>>> import xarray as xr
>>> top = xr.Dataset({"number_concentration": 240.0, "liquid_water_content": 2.0})
>>> out = rain_shaft_bulk(top, depth=[0.0, 4000.0])
>>> bool(out.mean_volume_diameter.isel(depth=1) < out.mean_volume_diameter.isel(depth=0))
True