fastscapelib.FlowGraphImpl#
- class fastscapelib.FlowGraphImpl#
Flow graph fixed-shape array implementation.
This class has no initializer. Instead, use the
FlowGraph.impl()
method to access an implementation instance from a flow graph instance.This class exposes low-level arrays of fixed-shape used to represent the flow graph. In general,
FlowGraph
API should be used instead when possible.IMPORTANT NOTES:
This class is not considered as part of Fastscapelib’s public API!
The (read-only) properties of this class return the original arrays (no copy). Directly changing value items may invalidate the flow graph.
- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)Attributes
Returns an array with the id of the basin (catchment) to which each node belongs.
Deprecated alias of
FlowGraphImpl.nodes_indices_bottomup
.Returns the array of flow donor grid node (flat) indices.
Returns the total number of donors for each node (1-dimensional array).
Returns the node indices ordered topologically from base level nodes up to top nodes.
Returns the array of flow receiver grid node (flat) indices.
Returns the total number of receivers for each node (1-dimensional array).
Returns the array of distances from a node to each of its receivers.
Returns the array of flow partition weights from a node to each of its receivers.
Returns True if the graph has single flow directions (flow tree).
- property basins#
Returns an array with the id of the basin (catchment) to which each node belongs.
Array values are valid only for a single-flow graph!
- property dfs_indices#
Deprecated alias of
FlowGraphImpl.nodes_indices_bottomup
.
- property donors#
Returns the array of flow donor grid node (flat) indices.
The array has the shape
(size, n_neighbors_max)
.Note: values returned by
donors[i, j]
wherej >= donors_count[i]
are meaningless.
- property donors_count#
Returns the total number of donors for each node (1-dimensional array).
- property nodes_indices_bottomup#
Returns the node indices ordered topologically from base level nodes up to top nodes.
The order results from graph traversal using depth-first search.
- property receivers#
Returns the array of flow receiver grid node (flat) indices.
The shape of the array is either
(size, 1)
for single flow graphs or(size, n_neighbors_max)
for multiple flow graphs.For base-level or pit nodes: flow receiver index = node index.
Note: values returned by
receivers[i, j]
wherej >= receivers_count[i]
are meaningless.
- property receivers_count#
Returns the total number of receivers for each node (1-dimensional array).
- property receivers_distance#
Returns the array of distances from a node to each of its receivers.
The shape of the array is either
(size, 1)
for single flow graphs or(size, n_neighbors_max)
for multiple flow graphs.Note: values returned by
receivers_distance[i, j]
wherej >= receivers_count[i]
are meaningless.
- property receivers_weight#
Returns the array of flow partition weights from a node to each of its receivers.
The shape of the array is either
(size, 1)
for single flow graphs or(size, n_neighbors_max)
for multiple flow graphs.Note: values returned by
receivers_weight[i, j]
wherej >= receivers_count[i]
are meaningless.
- property single_flow#
Returns True if the graph has single flow directions (flow tree).