stilt.observations.variogram#

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

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 variogram in a bin is half the mean squared difference. Bins are half-open, [a, b). Pairs at zero separation are skipped, as are pairs at or beyond the last edge.

Parameters:
  • errors (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[bool | int | float | complex | str | bytes]]) – One error value per point (a wind component’s analysis minus observation, say).

  • lag (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[bool | int | float | complex | str | bytes]]) – The coordinate the separation is measured in, one value per point: minutes, metres, or an (n, 2) array of longitude and latitude in degrees, in which case the separation is the great-circle distance in kilometres.

  • group (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[bool | int | float | complex | str | bytes], None]) – A label per point; only points sharing a label are paired. For the vertical variogram of radiosonde errors that is the launch, for the time variogram of a station’s errors the station, for the horizontal variogram of a network the observation time. None pairs everything with everything, which is fine for a few thousand points and not for a few hundred thousand.

  • bins (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[bool | int | float | complex | str | bytes]]) – Separation bin edges, in the units of lag.

Returns:

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

Return type:

pandas.DataFrame