landlab.utils.return_array module#

Return array with same shape as grid elements.

Function to return an array stored at node or of shape (n_nodes,).

This function exists to take advantage of the use_field_name_array_or_value decorator which permits providing the surface as a field name or array.

Parameters:
  • grid (ModelGrid) –

  • value (field name, ndarray of shape (n_nodes, ), or single value.) –

Returns:

array

Return type:

ndarray of shape (n_nodes, )

return_array_at_node(grid, value)[source]#

Function to return an array stored at node or of shape (n_nodes,).

This function exists to take advantage of the use_field_name_array_or_value decorator which permits providing the surface as a field name or array.

Parameters:
  • grid (ModelGrid) –

  • value (field name, ndarray of shape (n_nodes, ), or single value.) –

Returns:

array

Return type:

ndarray of shape (n_nodes, )