pywatershed.ObsInFlowNode#

class pywatershed.ObsInFlowNode(control, node_obs_data)[source]#

A FlowNode that takes inflows but returns observed/specified flows.

This FlowNode replicates the obsin and obsout seg functionality in PRMS but does so by inserting a new node in a FlowGraph rather than altering the flow on an existing node. This node is NOT mass conservative and tracks a sink_source term to describe mass lost and created at each subtimestep.

See FlowGraph for examples and discussion.

__init__(control, node_obs_data)[source]#

Initialize an ObsInFlowNode.

Parameters:
  • control (Control) – a Control object.

  • node_obs_data (Series) – A pandas Series object of observations at this location given by pyPRMS.Streamflow.

Methods

__init__(control, node_obs_data)

Initialize an ObsInFlowNode.

advance()

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, ...)

Calculate the subtimestep.

finalize_timestep()

Finalize the current timestep at this FlowNode.

prepare_timestep()

Prepare the subtimestep for subtimestep calculations.

Attributes

outflow

The average outflow of the FlowNode over the current timestep.

outflow_substep

The outflow of the FlowNode over the sub-timestep.

sink_source

Average sink and source through the last subtimestep Sink is negative, indicating that incoming flow is being discarded (if it were being stored, the storage change would be the opposite sign).

storage

The storage of the FlowNode at the current subtimestep.

storage_change

The storage change of the FlowNode at the current subtimestep.

advance()[source]#

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, inflow_upstream, inflow_lateral)[source]#

Calculate the subtimestep.

Parameters:
  • isubstep (int) – Zero-based integer indicating the index of the current substep.

  • inflow_upstream (float) – The in-channel flows to this FlowNode on the current substep.

  • inflow_lateral (float) – The later flows to this FlowNode on the current substep.

finalize_timestep()[source]#

Finalize the current timestep at this FlowNode.

property outflow#

The average outflow of the FlowNode over the current timestep.

property outflow_substep#

The outflow of the FlowNode over the sub-timestep.

prepare_timestep()[source]#

Prepare the subtimestep for subtimestep calculations.

property sink_source#

Average sink and source through the last subtimestep Sink is negative, indicating that incoming flow is being discarded (if it were being stored, the storage change would be the opposite sign). Source is positive, indicating that incoming flow is being augmented (if it were being stored, the storage change would be the opposite sign).

property storage#

The storage of the FlowNode at the current subtimestep.

property storage_change#

The storage change of the FlowNode at the current subtimestep.