python_codes.DEM_analysis.array_transect#

array_transect(A, p0, p1, type='cubic', num=100)[source]#

Compute the profile between to points inside a matrix.

Parameters
  • A (array_like, shape(M, N)) – Input array.

  • p0 (array_like, shape(2,)) – Pixel coordinates of the starting point.

  • p1 (array_like, shape(2,)) – Pixel coordinates of the ending point.

  • type (str, optional) – Type of the interpolation: ‘nearest’ or ‘cubic’ (the default is ‘nearest’).

  • num (int, optional) – Size of the output interpolated transect (the default is 100).

Returns

Interpolated transect between p0 and p1.

Return type

array_like, shape(num,)