Methods to run a network or node

Streamfall.align_time_frameMethod
align_time_frame(timeseries::T...)

Subset an arbitrary number of DataFrames to their shared period of time.

Returns subsetted copy of data in same order as input.

Example

julia> climate, streamflow = align_time_frame(climate, streamflow)
source
Streamfall.prep_state!Method
prep_state!(sn::StreamfallNetwork, timesteps::Int64)::Nothing

Prepare a network for a run by pre-allocating result stores.

source
Streamfall.run_basin!Method
run_basin!(sn::StreamfallNetwork, climate::Climate; inflow=nothing, extraction=nothing, exchange=nothing)

Run scenario for an entire catchment/basin.

source
Streamfall.run_node!Method
run_node!(
    node::NetworkNode, climate::Climate, ts::Int;
    inflow=nothing, extraction=nothing, exchange=nothing
)

Run a specific node for a specified time step.

Arguments

  • node : A node in a network
  • climate : Climate dataset
  • ts : current time step
  • inflow : Time series of inflows from upstream nodes.
  • extraction : Time series of water orders (expects column of _releases)
  • exchange : Time series of groundwater flux
source
Streamfall.run_node!Method
run_node!(
    node::NetworkNode, climate::Climate;
    inflow=nothing, extraction=nothing, exchange=nothing
)::Nothing

Run a specific node, and only that node, for all time steps.

Arguments

  • node : Any Streamfall NetworkNode
  • climate : Climate data
  • inflow::Union{DataFrame, Vector, Number} : Inflow to node
  • extraction::Union{DataFrame, Vector, Number} : Extractions from this subcatchment
  • exchange::Union{DataFrame, Vector, Number} : Groundwater flux
source
Streamfall.run_node!Method
run_node!(
    sn::StreamfallNetwork, node_id::Int, climate::Climate, ts::Int64;
    inflow=nothing, extraction=nothing, exchange=nothing
)::Nothing

Generic run method that runs a model attached to a given node for a given timestep. Recurses upstream as needed.

Arguments

  • sn::StreamfallNetwork
  • node_id : Node to run in the network
  • climate : Climate object holding rainfall and evaporation data (or temperature)
  • ts : Timestep to run
  • extraction : Water orders for each time step (defaults to nothing)
  • exchange : Exchange with groundwater system at each time step (defaults to nothing)
source