glidertools.mapping.variogram

glidertools.mapping.variogram(variable, horz, vert, dives, mask=None, xy_ratio=1, max_points=5000, ax=True)

Find the interpolation parameters and x and y scaling of the horizontal and vertical coordinate paramters for objective interpolation (Kriging).

The range of the variogram will automatically be scaled to 1 and the x and y length scales will be given in the output. This can be used in the gt.mapping.interp_obj function.

Parameters:
  • variable (array-like) – target variable for interpolation as a flat array

  • horz (array-like) – the horizontal coordinate variable as a flat array. Can be time in np.datetime64 format, or any other float value

  • vert (array-like) – the vertical coordinate variable as a flat array. Usually depth, but can be pessure or any other variable.

  • dives (array-like) – the dive numbers as a flat array

  • mask (array-like) – a boolean array that can be used to retain certain regions, e.g. depth < 250

  • xy_ratio (float) – determines the anisotropy of the coordinate variables. The value can be changed iteritively to improve the shape of the semivariance curve. The range of the variogram will automatically be scaled to 1. The x and y length scales are given in the output.

  • max_points (int) – maximum number of points that will be used in the variogram. The function selects a subset of dives rather than random points to be consistent in the vertical. Increasing this number will increase the accuracy of the length scales.

  • ax (bool or mpl.Axes) – If True, will automatically create an axes, if an axes object is given, returns the plot in those axes.

Returns:

  • variogram_params (dict) – a dictionary containing the information required by the gt.mapping.interp_obj function.

  • plot (axes) – a axes object containing the plot of the semivariogram

Example

>>> gt.mapping.variogram(var, time, depth, dives, mask=depth<350,
                         xy_ratio=0.5, max_points=6000)