radarx.retrieve.multidoppler.dual_doppler_analytic#
- radarx.retrieve.multidoppler.dual_doppler_analytic(grids, background=None, *, field='VRADH', dbz='DBZH', obs_error=None, min_crossing_angle=30.0, fall_speed_correction=True, freezing_level='auto', melting_depth=500.0, boundary='upward', w_bottom=0.0, terrain=None, obrien_error='linear', iterations=3, n_threads=None, engine='auto')[source]#
Dual-Doppler winds by the classical analytic solution, for quick checks.
At every grid cell the radial velocity of radar \(k\) is
\[v_{r,k} = u\, a_k + v\, b_k + (w - V_t)\, c_k, \quad a_k = \cos\phi_k \sin\alpha_k, \; b_k = \cos\phi_k \cos\alpha_k, \; c_k = \sin\phi_k ,\]with the beam azimuth \(\alpha_k\) and elevation \(\phi_k\) (
radar_geometry()) and the fall speed \(V_t\) (fall_speed()). With \(w\) known, the two unknownsuandvfollow from the weighted least-squares solution of \(N (u, v)^T = r\),\[\begin{split}N = \sum_k \sigma_k^{-2} \begin{pmatrix} a_k^2 & a_k b_k \\ a_k b_k & b_k^2 \end{pmatrix}, \qquad r = \sum_k \sigma_k^{-2} (a_k, b_k)^T (v_{r,k} + c_k V_t - c_k w) ,\end{split}\]which for two radars is the 2 x 2 system of the classical dual-Doppler analysis and for more radars the least-squares solution. Then
wfollows from the anelastic continuity equation, \(\partial(\rho w)/\partial z = -\partial(\rho u)/\partial x - \partial(\rho v)/\partial y\), integrated with the trapezoid rule from the lower boundary (boundary="upward"), from the top ("downward") or upward with the O’Brien adjustment so that \(w = 0\) at the top ("obrien"). The two steps are repeatediterationstimes, starting with \(w = 0\) in the first one. The horizontal wind uses finite differences as inmulti_doppler()(centred, one-sided at the edges).The solution is the textbook counterpart of the variational
multi_doppler(): it follows the data exactly where two beams cross well, has no smoothness or mass constraint onuandv, no interpolation across gaps, and gives NaN where it cannot be computed. Use it to check a variational retrieval and to see where the geometry allows a dual-Doppler analysis at all.- Parameters:
grids (
xarray.Datasetor sequence ofxarray.Dataset) – As formulti_doppler().background (
xarray.Dataset, optional) – Only theair_densityand the freezing level (freezing_levelortemperature) are used, as inmulti_doppler().field, dbz (
str, optional) – Field names. Default"VRADH"and"DBZH".obs_error (
float, sequence offloat,xarray.DataArrayorarray, optional) – Standard deviation (m s-1) of the radial velocity error, as formulti_doppler(). Without it every observation has the weight 1 and the errors returned are in units of the (unknown, equal) radial velocity error.min_crossing_angle (
float, optional) – Cells where the largest horizontal angle between two beams is smaller than this (degrees) are not solved. Default 30, the lower limit that is commonly used for dual-Doppler analyses (a radarx choice). Cells seen by fewer than two radars are never solved.fall_speed_correction (
bool, optional) – Correct for the precipitation fall speed. Default True.freezing_level, melting_depth (optional) – As for
multi_doppler().boundary (
{"upward", "downward", "obrien"}, optional) – Integration of the continuity equation: upward fromw_bottomatz[0], downward fromw = 0atz[-1], or upward with the O’Brien adjustment (see the Notes). Default"upward".w_bottom (
floatorxarray.DataArray, optional) –w(m s-1, or on(y, x)) atz[0]for"upward"and"obrien". Default 0.terrain (
xarray.DataArrayorarray, optional) – Terrain height (m above sea level) on(y, x), as formulti_doppler(): levels follow the terrain, the integration of the continuity equation is that of \(W = w - u\, \partial h/\partial x - v\, \partial h/\partial y\) fromW = w_bottomat the ground, andwis returned. Default None.obrien_error (
{"linear", "constant"}, optional) – Shape of the adjustment forboundary="obrien", as inmulti_doppler().iterations (
int, optional) – Number of horizontal-wind and integration passes. Default 3.n_threads (
int, optional) – Threads for the compiled kernels. Default: all cores.engine (
{"auto", "compiled", "numpy"}, optional) – Implementation of the cell and column kernels.
- Returns:
xarray.Dataset– On(z, y, x):u,v,w,u_errorandv_error(standard deviation of the error of the horizontal wind from the errors of the radial velocities, m s-1),fall_speed,n_radarsandbeam_crossing_angle. NaN where no wind is solved and inwbeyond the first level with a NaN divergence.attrsgive the boundary condition, the number of passes and the rms change ofwin the last one.
Notes
Horizontal wind error. The covariance of the least-squares solution is \(N^{-1}\) (the Gauss-Markov covariance of independent radial velocity errors \(\sigma_k\), for known \(w\) and \(V_t\)), so \(\sigma_u^2 = N_{22}/\det N\), \(\sigma_v^2 = N_{11}/\det N\). For two radars with equal errors \(\sigma\) and beam elevations \(\phi_1,\phi_2\), \(\det N = \sigma^{-4} \cos^2\phi_1\cos^2\phi_2 \sin^2\beta\) with the crossing angle \(\beta\) and
\[\sigma_u^2 + \sigma_v^2 = \sigma^2 \frac{\cos^2\phi_1 + \cos^2\phi_2} {\cos^2\phi_1 \cos^2\phi_2 \sin^2\beta} \;\to\; \frac{2 \sigma^2}{\sin^2\beta} \quad (\phi_1 = \phi_2 = 0),\]the geometric dilution of precision of the dual-Doppler wind: the error is smallest, \(\sqrt{2}\sigma\), at \(\beta = 90\) degrees and grows without limit as the beams become parallel. This is derived here from the linear system and is not taken from a paper. It covers the noise of the radial velocities only, not errors of the fall speed, of
w(the term \(c_k w\)), of the gridding or of the time difference between the radars.Vertical velocity. No error is given for
w: it is an integral of the divergence, and the errors of the divergence of neighbouring cells and levels are strongly correlated (all come from the same beams), which the cell-wise errors do not describe.multi_doppler()witherror=Truereturns aw_error.O’Brien adjustment. Upward integration of the continuity equation makes the error of the divergence accumulate in
wwith height. O’Brien (1970) [1] adjusts the divergence profile so that the vertical velocity is zero at the top. radarx implements the form of the ARPS ADAS routineadjuvw(open source, Center for Analysis and Prediction of Storms, University of Oklahoma) and of the description of the O’Brien correction in the GEMPAK documentation ofGDOMEG(pressure coordinates): the adjusted divergence minimises the squared difference to the observed one subject to the continuity equation with \(w = 0\) at the top, and the error of the divergence is assumed to grow linearly with height. In the anelastic form the mass flux \(\rho w\) is reduced by the fraction \(s(z) = ((z - z_0)/(z_{top} - z_0))^2\) of its value at the top,\[(\rho w)_{adj}(z) = \rho w(z) - s(z)\, (\rho w)(z_{top}) ,\]which leaves \(z_0\) unchanged and gives \(w = 0\) at \(z_{top}\); the correction of the mass-weighted divergence, \(\rho\, \delta D = -\partial_z (s\, (\rho w)_{top})\), then grows linearly from \(z_0\).
obrien_error="constant"takes the mass-weighted divergence error constant instead, \(s = (z - z_0)/ (z_{top} - z_0)\) (the exponent 1), the minimiser of the integral of \((\rho\,\delta D)^2\) with \(w = 0\) at the top, derived here from first principles. The equations and the weighting of the paper itself and the choice of the default have not been checked against it; the implementation follows the open code and the description cited above. The adjustment uses the highest grid level as the top and needs a full column, so indual_doppler_analytica column with a gap in the divergence is NaN.The integration uses the trapezoid rule on the grid levels. Errors of the quadrature are of second order in the vertical spacing.
Dask. This function computes the dask array: the wind is solved for all grid cells at once. The input is loaded into memory and the result is held in memory.
References
Examples
>>> wind = radarx.retrieve.dual_doppler_analytic(grids, boundary="obrien")