wradlib.dp.DpMethods.delta_phidp

wradlib.dp.DpMethods.delta_phidp#

DpMethods.delta_phidp(rng, **kwargs)[source]#

Estimate \(\Phi_{DP}\) statistics from the first and last densest range windows.

This function analyzes an xarray DataArray phidp defined along a coordinate named range and identifies:

  • the first range window spanning at least rng that contains the maximum number of valid (non-NaN) observations, and

  • the last such window when scanning from the far end of the ray.

For each window, the median phase value is computed. The phase difference between the last and first window is returned together with diagnostic information.

Parameters:
  • phidp (xarray.DataArray) – Input phase-like data indexed by a coordinate named range. NaN values are treated as missing data.

  • rng (float) – Desired window width in the same units as phidp.range. The actual width used is the smallest whole-gate window that spans at least rng.

Keyword Arguments:

min_periods (int) – Minimum number of valid samples required within a rolling window. Defaults to the full window size.

Returns:

xarray.Dataset – Dataset containing:

phibxarray.DataArray

Rolling count of valid observations.

start_rangexarray.DataArray

Left edge of the first densest window.

stop_rangexarray.DataArray

Right edge of the last densest window.

firstxarray.DataArray

Median phase within the first densest window.

first_idxxarray.DataArray

Index of the left edge of the first densest window.

lastxarray.DataArray

Median phase within the last densest window.

last_idxxarray.DataArray

Index of the right edge of the last densest window.

dphixarray.DataArray

Difference between last and first. Total \(\Delta \Phi_{DP}\).

center_spanfloat

center-to-center span of selected bins

Notes

  • Assumes uniform spacing along phi.range.

  • The rolling count is computed using center=False.

  • If multiple windows contain the same maximum number of valid observations, the first occurrence is selected.

  • start_range refers to the left edge of the first densest window.

  • stop_range refers to the right edge of the last densest window.

  • The actual window width may be slightly larger than rng because whole range bins are used.

Examples

See Core Features - Dual-Pol - Total Differential Phase Shift.