mpas_tools.transects.subdivide_planar

mpas_tools.transects.subdivide_planar(x, y, maxRes)[source]

Subdivide each segment of the transect so the horizontal resolution approximately matches the requested resolution

Uses a formula for interpolating unit vectors on the sphere from https://en.wikipedia.org/wiki/Slerp

Parameters
  • x (numpy.array) – The planar coordinates of a transect, where the number of segments is len(x) - 1. x and y are of the same length.

  • y (numpy.array) – The planar coordinates of a transect, where the number of segments is len(x) - 1. x and y are of the same length.

  • maxRes (float) – The maximum allowed spacing in m after subdivision

Returns

  • xOut, yOut (numpy.array) – The transect subdivided into segments with segment length at most maxRes. All the points in x and y are guaranteed to be included.

  • dIn (numpy.array) – The distance along the transect before subdivision

  • dOut (numpy.array) – The distance along the transect after subdivision