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) andliquid_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 ofradarx.retrieve.rain_shaft(). Not changed. A dask-backed input gives a lazy result.depth (
floator array-like) – Distance (m) below the top where the rain is wanted: one value (a scalardepthcoordinate) or an ascending series (not negative), thedepthdimension.density_correction (
bool, optional) – Multiply the fall speeds and the collision rate by \((\rho_0/\rho)^{0.4}\). Default True; withoutprofileandtop_heightthe air is at the sea-level density.profile (
xarray.Dataset, optional) – Profile onheight(m above sea level) withair_densityorpressureandtemperature(andspecific_humidity), seeradarx.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 withprofile.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 ofrainwithdepth(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) andrain_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 unknownengineor a profile that does not cover the shaft.TypeError – If
rainis 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