class wradlib.ipol.OrdinaryKriging(src, trg, cov='1.0 Exp(10000.)', nnearest=12)[source]#

Bases: IpolBase

Interpolate using Ordinary Kriging

(Co-)Variogram definitions are given in the syntax that gstat uses. It allows nesting of different basic variogram types using linear combinations. Each basic covariogram is usually defined by Note that, strictly speaking, this implementation doesn’t allow Kriging of fields for which the covariance does not exist. While this is mathematically possible, it is rather rare for fields encountered in reality. Therefore, this should not be a severe limitation.

Most (co-)variograms are characterized by a sill parameter (which is the (co-)variance at separation distance 0) a range parameter (which indicates a separation distance after which the covariance drops close to zero) a sometimes additional parameters governing the shape of the function. In the following range is given by the variable r and the sill by the variable s. Currently implemented are:

  • Pure Nugget

  • Exponential

  • Spherical

  • Gaussian

  • Linear

  • Matern

  • Power

  • Cauchy

  • src (numpy.ndarray) – ndarray of floats, shape (npoints, ndims) Data point coordinates of the source points.

  • trg (numpy.ndarray) – ndarray of floats, shape (npoints, ndims) Data point coordinates of the target points.

  • cov (str) – covariance (variogram) model string in the syntax gstat uses.

  • nnearest (int) – max. number of neighbours to be considered

  • remove_missing (bool) – If True masks NaN values in the data values, defaults to False


The class calculates the Kriging weights during initialization, because these only depend on the configuration of the points.

The call method is then only used to calculate estimated values at the target points based on those at the source points. Therefore, the main computational load is experienced during initialization. This behavior is different from that of the Idw or Nearest Interpolators.

After initialization the estimation variance at each interpolation target may be retrieved from the attribute estimation_variance.


See How to use wradlib's ipol module for interpolation tasks?.


Evaluate interpolator for values given at the source points.