xoa.krig.Kriger
- class xoa.krig.Kriger(da: DataArray, krigtype, variogram_func, npmax=None, nproc=None, exact=False, dist_units=None, mean=None, farvalue=None, **kwargs)[source]
Kriger that supports clusterization to limit memory
Big input cloud of points (size >
npmax
) are split into smaller clusters using cluster analysis of distance with functionclusterize()
.The problem is solved in this way:
Input points are split in clusters if necessary.
The input variogram matrix is inverted for each cluster, possibly using
multiprocessing
ifnproc>1
.Values are computed at output positions each using the inverted matrix of cluster.
Final value is a weighted average of the values estimated using each cluster. Weights are inversely proportional to the inverse of the squared error.
- Parameters:
da (xarray.DataArray, xarray.Dataset) – Input positions and optionaly data.
krigtype (optional) – Kriging type:
1|"ordinary"
,0|"simple"
.variogram_func (callable, VariogramModel, optional) – Callable to be used as a variogram function. It is either a function or an instance of
VariogramModel
.npmax (optional) – Maximal number of points to be used simultanously for kriging. When the number of input points is greater than this value, clusterization is applied.
nproc (optional) – Number of processes to use to invert matrices. Set it to a number <2 to switch off parallelisation.
exact (optional) – If True, variogram is exactly zero when distance is zero.
- __init__(da: DataArray, krigtype, variogram_func, npmax=None, nproc=None, exact=False, dist_units=None, mean=None, farvalue=None, **kwargs)[source]
Methods
interp
(dso[, block, name])Interpolate to the dso positions
Attributes
Get the inverse of the A matrix
Distance units
Number of clusters
Max number of points per cluster
Variogram function or callable, like a
VariogramModel
instance