pyPDAF.PDAF.local_weights¶
- pyPDAF.PDAF.local_weights()¶
Get a vector of localisation weights for given distances, 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.
This function is a vectorised version of
pyPDAF.PDAF.local_weight()
without any regulations.- 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)
dim (int) – Size of distance and weight arrays
distance (ndarray[np.float64, ndim=1]) – distance to observation Array shape: (dim)
verbose (int) – Verbosity flag
- Returns:
weight – Array for localisation weights Array shape: (dim)
- Return type:
ndarray[np.float64, ndim=1]