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.ndarray) – The planar x coordinate of a transect, where the number of segments is
len(x) - 1
y (numpy.ndarray) – The planar y coordinates of the transect, the same length as
x
maxRes (float) – The maximum allowed spacing in m after subdivision
- Returns:
xOut (numpy.ndarray) – The x coordinate of the transect, subdivided into segments with length at most
maxRes
. All the points inx
are guaranteed to be included.yOut (numpy.ndarray) – The y coordinate of the transect. All the points in
y
are guaranteed to be included.dIn (numpy.ndarray) – The distance along the transect before subdivision
dOut (numpy.ndarray) – The distance along the transect after subdivision