stilt.observations.variogram#

stilt.observations.variogram(errors, lag, *, group=None, bins)[source]#

Return the empirical semivariogram of errors over a separation coordinate.

For every pair of points in the same group, the squared difference of their errors is binned by their separation. The semivariogram of a bin is half the mean squared difference. Bins are half-open, [a, b). Pairs at zero separation or at or beyond the last edge are skipped.

Parameters:
  • errors (TypeAliasType) – One error per point, such as the analysis minus observed value of one wind component.

  • lag (TypeAliasType) – Coordinate the separation is measured in, one value per point, such as minutes or meters. An (n, 2) array of longitude and latitude in degrees measures great-circle distance in km.

  • group (TypeAliasType | None) – Label per point. Only points with the same label are paired: the launch for a vertical variogram of radiosonde errors, the station for a time variogram, the observation time for a horizontal variogram of a network. None pairs every point with every other, which is fine for a few thousand points but not for a few hundred thousand.

  • bins (TypeAliasType) – Separation bin edges, in the units of lag.

Returns:

One row per non-empty bin, with columns lag (mean separation of the pairs), gamma (semivariogram, in the units of errors squared), and n (number of pairs).

Return type:

DataFrame