xoa.krig.empirical_variogram#
- xoa.krig.empirical_variogram(da: DataArray, nbin=30, nbin0=10, nmax=1500, dist_units='m', distmax=None, errfunc=None)[source]#
Compute the semi-variogram from data
- Parameters:
da (xarray.DataArray) – Data array with lon and lat coordinates.
nbin (optional) – Number of bins of pairs of points sorted by distance.
nbin0 (optional) – If greater than 1, the first bin is split into nbin0 sub-bins.
nmax (optional) – Above this number, size of the sample is reduced by a crude undersampling.
dist_units (str, int, xoa.geo.distance_units) – Distance units as one of:
0|"m"|"meters"|"meter",1|"km"|"kilometers"|"kilometer"distmax (optional) – Max distance to consider.
errfunc (optional) – Callable function to compute “errors” like square root difference between to z values. It take two arguments and defaults to \((z1-z0)^2/2\).
- Returns:
xarray.DataArray – Values as 1D array with name “semivariogram” and with “dist” as distance coordinate in km