Network
Streamfall.area
— Methodarea(sn::StreamfallNetwork)::Float64
Total area represented by a network.
Streamfall.create_network
— Methodcreate_network(name::String, network::AbstractDict)::StreamfallNetwork
Create a StreamNetwork from a YAML-derived specification.
Example
julia> using OrderedCollections
julia> network_spec = YAML.load_file("example_network.yml"; dicttype=OrderedDict{Any,Any})
julia> sn = create_network("Example Network", network_spec)
Streamfall.create_node
— Methodcreate_node(mg::MetaDiGraph, node_name::String, details::AbstractDict, nid::Int)
Create a node specified with given name (if it does not exist).
Returns
this_id
: ID of node (if pre-existing) andnid
: incremented node id for entire network (equal tothis_id
if exists)
Streamfall.extract_network_spec
— Methodextract_network_spec(sn::StreamfallNetwork)
Extract network details
Streamfall.find_inlets_and_outlets
— Methodfind_inlets_and_outlets(sn::StreamfallNetwork)::Tuple
Find all inlets and outlets in a network.
Streamfall.in_or_out
— Methodin_or_out(g, v)
Determine a node's connection
Streamfall.inlets
— Methodinlets(sn::StreamfallNetwork, node_name::String)
Find ID(s) of nodes which provides inflows for given node.
Streamfall.outlets
— Methodoutlets(sn::StreamfallNetwork, node_name::String)
Find ID(s) of node immediately downstream from given node.
Streamfall.plot_network
— Methodplot_network(sn::StreamfallNetwork)
Simple plot of stream network.
Streamfall.reset!
— Methodreset!(sn::StreamfallNetwork)::Nothing
Reset a network.
Streamfall.save_figure
— Methodsave_figure(sn::StreamfallNetwork, fn::String)
Save a figure of the network in SVG format.
Streamfall.save_network
— Methodsave_network(sn::StreamfallNetwork, fn::String)::Nothing
Save network specification to a YAML file.