wradlib.dp.DpMethods#

class wradlib.dp.DpMethods(obj)[source]#

Bases: XarrayMethods

wradlib xarray SubAccessor methods for DualPol.

depolarization(**kwargs)[source]#

Compute the depolarization ration.

Compute the depolarization ration using differential reflectivity \(Z_{DR}\) and crosscorrelation coefficient \(Rho_{HV}\) of a radar sweep ([Kilambi et al., 2018], [Melnikov et al., 2013], [Ryzhkov et al., 2017]).

Parameter#

obj : xarray.Dataset

keyword zdr:

name of differential reflectivity

kwtype zdr:

str

keyword rho:

name crosscorrelation coefficient

kwtype rho:

str

returns:

depolarization (xarray.DataArray) – array of depolarization ratios with the same shape as input data, numpy broadcasting rules apply

kdp_from_phidp(*, winlen=7, **kwargs)[source]#

Retrieves \(K_{DP}\) from \(Phi_{DP}\).

Parameter#

objxarray.DataArray

DataArray containing differential phase

keyword winlen:

window length

kwtype winlen:

int

keyword method:

Defaults to ‘lanczos_conv’. Can also take one of ‘lanczos_dot’, ‘lstsq’, ‘cov’, ‘cov_nan’, ‘matrix_inv’.

kwtype method:

str

keyword skipna:

Defaults to True. Local Linear regression removing NaN values using valid neighbors > min_periods

kwtype skipna:

bool

keyword min_periods:

Minimum number of valid values in moving window for linear regression. Defaults to winlen // 2 + 1.

kwtype min_periods:

int

returns:

out (xarray.DataArray) – DataArray

phidp_kdp_vulpiani(*, winlen=7, **kwargs)[source]#

Retrieves \(K_{DP}\) from \(Phi_{DP}\).

Parameter#

objxarray.DataArray

DataArray containing differential phase

winlenint

window length

keyword method:

Defaults to ‘lanczos_conv’. Can also take one of ‘lanczos_dot’, ‘lstsq’, ‘cov’, ‘cov_nan’, ‘matrix_inv’.

kwtype method:

str

keyword skipna:

Defaults to True. Local Linear regression removing NaN values using valid neighbors > min_periods

kwtype skipna:

bool

keyword min_periods:

Minimum number of valid values in moving window for linear regression. Defaults to winlen // 2 + 1.

kwtype min_periods:

int

returns:
texture()[source]#

Compute the texture of data.

Compute the texture of the data by comparing values with a 3x3 neighborhood (based on [Gourley et al., 2007]). NaN values in the original array have NaN textures.

Parameters:

obj (xarray.DataArray) – DataArray

Returns:

texture (xarray.DataArray) – DataArray

unfold_phi(**kwargs)[source]#

Unfolds differential phase by adjusting values that exceeded maximum ambiguous range.

Accepts arbitrarily dimensioned arrays, but THE LAST DIMENSION MUST BE THE RANGE.

This is the fast Fortran-based implementation (RECOMMENDED).

The algorithm is based on the paper of [Wang et al., 2009].

Parameters:

obj (xarray.Dataset)

Keyword Arguments:
  • phidp (str) – name of PhiDP data variable

  • rho (str) – name of RhoHV data variable

  • width (int) – Width of the analysis window

Returns:

out (xarray.DataArray) – DataArray

unfold_phi_vulpiani(**kwargs)[source]#

Alternative phase unfolding which completely relies on \(K_{DP}\).

This unfolding should be used in oder to iteratively reconstruct \(Phi_{DP}\) and \(K_{DP}\) (see [Vulpiani et al., 2012]).

Note

\(Phi_{DP}\) is assumed to be in the interval [-180, 180] degree. From experience the window for calculation of \(K_{DP}\) should not be too large to catch possible phase wraps.

Parameters:

obj (xarray.Dataset) – Dataset

Keyword Arguments:
  • phidp (str) – name of PhiDP

  • kdp (str) – name of KDP

  • th (float) – Threshold th3 in the above citation.

  • winlen (int) – Length of window to fix possible phase over-correction. Normally should take the value of the length of the processing window in the above citation.

Returns:

out (xarray.DataArray) – DataArray

depolarization(**kwargs)

Compute the depolarization ration.

kdp_from_phidp(*[, winlen])

Retrieves \(K_{DP}\) from \(Phi_{DP}\).

phidp_kdp_vulpiani(*[, winlen])

Retrieves \(K_{DP}\) from \(Phi_{DP}\).

texture()

Compute the texture of data.

unfold_phi(**kwargs)

Unfolds differential phase by adjusting values that exceeded maximum ambiguous range.

unfold_phi_vulpiani(**kwargs)

Alternative phase unfolding which completely relies on \(K_{DP}\).