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 function clusterize().

The problem is solved in this way:

  1. Input points are split in clusters if necessary.

  2. The input variogram matrix is inverted for each cluster, possibly using multiprocessing if nproc>1.

  3. Values are computed at output positions each using the inverted matrix of cluster.

  4. 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

Ainv

Get the inverse of the A matrix

clusters

dist_units

Distance units

nclust

Number of clusters

npmax

Max number of points per cluster

variogram_func

Variogram function or callable, like a VariogramModel instance