pywatershed.SourceSinkFlowNode#

class pywatershed.SourceSinkFlowNode(control, flow_min, source_sink_data, missing_data_as_zero=False)[source]#

A FlowNode that adds or removes flow above some minimum flow parameter.

See FlowGraph for examples and discussion.

__init__(control, flow_min, source_sink_data, missing_data_as_zero=False)[source]#

Initialize an SourceSinkFlowNode.

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

  • flow_min (float64) – A floating point value for the minium flow.

  • source_sink_data (Series) – A pandas Series object of sources/sinks at this location. See SourceSinkFlowNodeMaker for a description of the pd.DataFrame passed to supply this data.

  • missing_data_as_zero (bool) – Bool option to treat missing times in the timeseries as having zero source/sink.

Methods

__init__(control, flow_min, source_sink_data)

Initialize an SourceSinkFlowNode.

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.

Return type:

None

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.

Return type:

None

property outflow: float64#

The average outflow of the FlowNode over the current timestep.

property outflow_substep: float64#

The outflow of the FlowNode over the sub-timestep.

prepare_timestep()[source]#

Prepare the subtimestep for subtimestep calculations.

Return type:

None

property sink_source: float64#

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: float64#

The storage of the FlowNode at the current subtimestep.

property storage_change: float64#

The storage change of the FlowNode at the current subtimestep.