xugrid.UgridDataArrayAccessor.to_edge#
- UgridDataArrayAccessor.to_edge(dim: str = 'nmax')[source]#
Map data to edges.
Creates a new dimension representing the contributing source elements for each node, as two nodes or two faces are connected to an edge.
- Parameters:
dim (str, optional)
- Returns:
mapped – A new UgridDataArray with data mapped to the edges of the grid.
- Return type:
Examples
Compute the mean elevation based on the nodes for each edge:
>>> edge_elevation = node_elevation.to_edge().mean("contributors")