landlab.components.lateral_erosion.node_finder

angle_finder(grid, dn, cn, rn)[source]

Find the interior angle between two vectors on a grid.

Parameters:
  • grid (ModelGrid) – A landlab grid.

  • dn (int or array of int) – Node or nodes at the end of the first vector.

  • cn (int or array of int) – Node or nodes at the vertex between vectors.

  • rn (int or array of int) – Node or nodes at the end of the second vector.

Returns:

Angle between vectors (in radians).

Return type:

float or array of float

Examples

>>> import numpy as np
>>> from landlab import RasterModelGrid
>>> from landlab.components.lateral_erosion.node_finder import angle_finder
>>> grid = RasterModelGrid((3, 4))
>>> np.rad2deg(angle_finder(grid, 8, 5, 0))
90.0
>>> np.rad2deg(angle_finder(grid, (8, 9, 10, 6), 5, 6))
array([135.,  90.,  45.,   0.])
forty_five_node(donor, i, receiver, neighbors, diag_neigh)[source]
ninety_node(donor, i, receiver, link_list, neighbors, diag_neigh)[source]
node_finder(grid, i, flowdirs, drain_area)[source]

Find lateral neighbor node of the primary node for straight, 45 degree, and 90 degree channel segments.

Parameters:
  • grid (ModelGrid) – A Landlab grid object

  • i (int) – node ID of primary node

  • flowdirs (array) – Flow direction array

  • drain_area (array) – drainage area array

Returns:

  • lat_node (int) – node ID of lateral node

  • radcurv_angle (float) – inverse radius of curvature of channel at lateral node

straight_node(donor, i, receiver, neighbors, diag_neigh)[source]