pyPDAF.PDAF.local_weight¶
- pyPDAF.PDAF.local_weight()¶
Get localisation weight for given distance, cut-off radius, support radius, weighting type, and weighting function.
This function is used in the analysis step of a filter to computes a localisation weight.
Typically, in domain-localised filters, the function is called in user-supplied
py__prodRinvA_l_pdaf()
. In LEnKF, this function is called in user-suppliedpy__localize_covar_pdaf()
.This function is usually only used without PDAF-OMI.
- Parameters:
wtype (int) –
- type of weight function:
wtype=0: unit weight (weight=1 up to distance=cradius)
wtype=1: exponential decrease (weight=1/e at distance=sradius; weight=0 for distance>cradius)
wtype=2: 5th order polynomial (Gaspari and Cohn 1999; weight=0 for distance>cradius)
rtype (int) –
- type of regulated weighting:
rtype/=1: no regulation
rtype=1: regulated by variance of the matrix A and the observation variance
cradius (float) – cut-off radius where weight = 0 beyond the cradius
sradius (float) –
- support radius of localisation function. This depends on wtype:
wtype=0: sradius is not used
wtype=1: weight = \(e^{-\frac{distance}{sradius}}\)
wtype=2: weight = 0 if distance > sradius else weight = f(distance ,sradius)
See also: PDAF-OMI wiki
distance (float) – distance to observation
nrows (int) – Number of rows in matrix A
ncols (int) – Number of columns in matrix A
a (ndarray[tuple[nrows, ncols, ...], np.float64]) – ensemble perturbation/anomaly matrix; this matrix is used when weighting is regulated by mean variance, i.e., rtype = 1. Array shape: (nrows, ncols)
var_obs (double) – Observation variance
verbose (int) – Verbosity flag
- Returns:
weight – localisation weights
- Return type:
double