mpas_tools.transects.subdivide_great_circle

mpas_tools.transects.subdivide_great_circle(x, y, z, maxRes, earthRadius)[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 Cartesian coordinates of a transect, where the number of segments is len(x) - 1. x, y and z are of the same length.

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

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

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

  • earthRadius (float) – The radius of the Earth in m

Returns

  • xOut, yOut, zOut (numpy.array) – The transect subdivided into segments with segment length at most maxRes. All the points in x, y and z 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