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.ndarray) – The Cartesian x coordinate of a transect, where the number of segments is len(x) - 1. x, y and z are of the same length.

  • y (numpy.ndarray) – The Cartesian y coordinate of the transect

  • z (numpy.ndarray) – The Cartesian z coordinate of the transect

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

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

Returns:

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

  • yOut (numpy.ndarray) – The Cartesian y values of the subdivided transect

  • zOut (numpy.ndarray) – The Cartesian y values of the subdivided transect

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

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