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.
nmax (optional) – Above this number, size of the sample is reduced by a crude undersampling.
binned (optional) – If set to a number, data are arranged in bins to estimate variogram. If set to
None
, data are arranged in bins if the number of pairs of points is greater thannbindef*nbmin
.nbindef (optional) – Default number of bins (not used if
binned
is a number).nbin0 (optional) – If set to a number > 1, the first bin is split into nbin0 sub-bins. If set to
None
, it is evaluated withmin(bins[1]/nbmin, nbin)
.nbmin (optional) – Minimal number of points in a bin.
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