pywatershed.StarfitSourceSinkFlowNode#

class pywatershed.StarfitSourceSinkFlowNode(control, grand_id, initial_storage, start_time, end_time, inflow_mean, NORhi_min, NORhi_max, NORhi_alpha, NORhi_beta, NORhi_mu, NORlo_min, NORlo_max, NORlo_alpha, NORlo_beta, NORlo_mu, Release_min, Release_max, Release_alpha1, Release_alpha2, Release_beta1, Release_beta2, Release_p1, Release_p2, Release_c, GRanD_CAP_MCM, Obs_MEANFLOW_CUMECS, source_sink_storage_min, source_sink_data, missing_data_as_zero=False, calc_method=None, io_in_cfs=True, nhrs_substep=np.float64(1.0), imbalance_behavior=None)[source]#

A StarfitFlowNode where sinks and sources interact with storage.

James McCreight (UCAR/USGS), John Engott (USGS), and Noah Knowles (USGS)

__init__(control, grand_id, initial_storage, start_time, end_time, inflow_mean, NORhi_min, NORhi_max, NORhi_alpha, NORhi_beta, NORhi_mu, NORlo_min, NORlo_max, NORlo_alpha, NORlo_beta, NORlo_mu, Release_min, Release_max, Release_alpha1, Release_alpha2, Release_beta1, Release_beta2, Release_p1, Release_p2, Release_c, GRanD_CAP_MCM, Obs_MEANFLOW_CUMECS, source_sink_storage_min, source_sink_data, missing_data_as_zero=False, calc_method=None, io_in_cfs=True, nhrs_substep=np.float64(1.0), imbalance_behavior=None)[source]#

Initialize a StarfitSourceSinkFlowNode.

Parameters:
  • control (Control) – A Control object

  • grand_id (int64) – the GRanD id,

  • initial_storage (float64) – initial storage value, may be NaN to use the middle of the normal operating range.

  • start_time (datetime64) – May be NaN, the optional time at which to start simulating with STARFIT.

  • end_time (datetime64) – As for start_Time.

  • inflow_mean (float64) – STARFIT parameter.

  • NORhi_min (float64) – STARFIT parameter.

  • NORhi_max (float64) – STARFIT parameter.

  • NORhi_alpha (float64) – STARFIT parameter.

  • NORhi_beta (float64) – STARFIT parameter.

  • NORhi_mu (float64) – STARFIT parameter.

  • NORlo_min (float64) – STARFIT parameter.

  • NORlo_max (float64) – STARFIT parameter.

  • NORlo_alpha (float64) – STARFIT parameter.

  • NORlo_beta (float64) – STARFIT parameter.

  • NORlo_mu (float64) – STARFIT parameter.

  • Release_min (float64) – STARFIT parameter.

  • Release_max (float64) – STARFIT parameter.

  • Release_alpha1 (float64) – STARFIT parameter.

  • Release_alpha2 (float64) – STARFIT parameter.

  • Release_beta1 (float64) – STARFIT parameter.

  • Release_beta2 (float64) – STARFIT parameter.

  • Release_p1 (float64) – STARFIT parameter.

  • Release_p2 (float64) – STARFIT parameter.

  • Release_c (float64) – STARFIT parameter.

  • GRanD_CAP_MCM (float64) – STARFIT parameter.

  • Obs_MEANFLOW_CUMECS (float64) – STARFIT parameter.

  • source_sink_storage_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. Units are cubic feet per second.

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

  • calc_method (Literal['numba', 'numpy']) – One of “numba” or “numpy”.

  • io_in_cfs (bool) – Are the units in cubic feet per second? False gives units of cubic meters per second.

  • nhrs_substep (int) – Number of hours in the subtimestep.

  • imbalance_behavior (Literal['defer', None, 'warn', 'error']) – One of “defer”, “warn”, or “error”.

Methods

__init__(control, grand_id, initial_storage, ...)

Initialize a StarfitSourceSinkFlowNode.

advance()

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, ...)

Calculate the subtimestep.

finalize_timestep()

Finalize the current timestep at this FlowNode.

get_mass_budget_terms()

Get a dictionary of variable names for mass budget terms.

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.

release

The release component of the STARFIT outflow.

sink_source

The sink or source amount of the FlowNode at the current subtimestep.

spill

The spill component of the STARFIT outflow.

storage

The storage of the FlowNode at the current subtimestep.

storage_change

The storage change of the FlowNode at the current subtimestep.

advance()#

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, inflow_upstream, inflow_lateral)#

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.

Return type:

None

finalize_timestep()[source]#

Finalize the current timestep at this FlowNode.

static get_mass_budget_terms()[source]#

Get a dictionary of variable names for mass budget terms.

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()#

Prepare the subtimestep for subtimestep calculations.

Return type:

None

property release: float64#

The release component of the STARFIT outflow.

property sink_source: float64#

The sink or source amount of the FlowNode at the current subtimestep.

property spill: float64#

The spill component of the STARFIT outflow.

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.