radarx.retrieve.rain_collisions.rain_shaft#
- radarx.retrieve.rain_collisions.rain_shaft(dsd, *, depth, collisions='low_list1982', fall_speed='drag_balance', density_correction=True, profile=None, top_height=None, step=10.0, cfl=0.25, n_threads=None, engine='auto')[source]#
Drop size distribution below the top of a rain shaft, with collisions.
Evolves the DSD of a column of still air as the drops fall, collide, coalesce and break up; the equations, the scheme of Low and List (1982), the choices of radarx and the limits are in
radarx.retrieve.rain_collisions.- Parameters:
dsd (
xarray.DataArray) – Number concentration per unit diameter (m-3 mm-1) at the top of the shaft, on adiameterdimension (mm, positive, ascending, at least three pivots, at most 256) and any other dimensions (every point is one independent column, for example the gates of a sweep or the times of a disdrometer). Not changed. A dask-backed input gives a lazy result.depth (
floator array-like) – Distance (m) below the top where the DSD is wanted: one value (a scalardepthcoordinate) or an ascending series (not negative), thedepthdimension.collisions (
{"low_list1982", "coalescence", "none"}, optional) – Outcome of a collision."low_list1982"(default): coalescence efficiency and breakup of Low and List (1982)."coalescence": every collision coalesces (classical accretion)."none": no collisions, which only changes the concentration with the density.fall_speed (
strortuple, optional) – Sea-level fall speed law ofradarx.retrieve.rain_trajectories()("drag_balance","atlas1973",(a, b, f)or("polynomial", c0, ...)). It must be positive at all pivots.density_correction (
bool, optional) – Multiply the fall speed by \((\rho_0/\rho)^{0.4}\) with the density ofprofile(or of a standard atmosphere if onlytop_heightis given). 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 busiest drop size collides once. 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 ofdsdwithdepth(if a series was given) beforediameter:dsd(m-3 mm-1),number_concentration(m-3),liquid_water_content(g m-3) andrain_rate(mm h-1; it does not change withdepthfor anycollisions: the test of the mass conservation). Columns with a NaN or a negative value give NaN.- Raises:
ValueError – For an unsupported
diameteraxis, a negative or descendingdepth, an unknown option, a fall speed that is not positive or a profile that does not cover the shaft.TypeError – If
dsdis not a DataArray.ImportError – If
engine="compiled"and the kernel is not available.
Notes
Sources: Low and List (1982a, b) for the coalescence efficiency and the breakup; McFarquhar (2004) for the mass-conserving large remnant; Prat and Barros (2007) for the collision efficiency of one. The interpretation of the printed equations, what was left out and the limits are in the module documentation.
Dask. Dask arrays stay lazy: the result is a dask array and nothing is computed until it is.
References
Examples
>>> import numpy as np, xarray as xr >>> d = np.geomspace(0.2, 7.0, 40) >>> nd = xr.DataArray(8000.0 * np.exp(-2.2 * d), dims="diameter", coords={"diameter": d}) >>> out = rain_shaft(nd, depth=[1000.0, 2000.0]) >>> bool(abs(out.rain_rate.isel(depth=1) / out.rain_rate.isel(depth=0) - 1.0) < 1e-9) True