pywatershed.StarfitSourceSinkFlowNodeMaker#

class pywatershed.StarfitSourceSinkFlowNodeMaker(discretization, parameters, source_sink_df, missing_data_as_zero=False, calc_method=None, io_in_cfs=True, verbose=None, imbalance_behavior=None, nhrs_substep=1)[source]#

STARFIT SourceSink FlowNodeMaker: STARFIT with diversions on storage.

__init__(discretization, parameters, source_sink_df, missing_data_as_zero=False, calc_method=None, io_in_cfs=True, verbose=None, imbalance_behavior=None, nhrs_substep=1)[source]#

Instantiate StarfitFlowNodeMaker.

Parameters:
  • discretization (Parameters) – A Parameters object.

  • parameters (Parameters) – A Parmaeters object with the parameters listed in StarfitFlowNode dimensioned by number of reservoirs/nodes to instantiate.

  • source_sink_df (DataFrame) – A pandas DataFrame of observations with a time index which can be selected by ‘%Y-%m-%d’ strftime of a datetime64. The column names are not used and may be anything, for example the nhm_seg of the upstream segment. However, the columns order MUST be collated with the input data vectors. The sign convention is: sources are positive and sinks are negative. That is, the sign is from the perspective of the node. 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”.

  • verbose (bool) – bool = None,

Methods

__init__(discretization, parameters, ...[, ...])

Instantiate StarfitFlowNodeMaker.

get_dimensions()

Get a tuple of dimension names for this StarfitFlowNodeMaker.

get_node(control, index)

Instantiate FlowNode at a given index.

get_parameters()

Get a tuple of parameter names for StarfitFlowNodeMaker.

static get_dimensions()[source]#

Get a tuple of dimension names for this StarfitFlowNodeMaker.

Return type:

tuple

get_node(control, index)[source]#

Instantiate FlowNode at a given index.

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

  • index (int) – The index in the discretization and parameter data to use when instantiating a FlowNode.

Return type:

StarfitSourceSinkFlowNode

static get_parameters()[source]#

Get a tuple of parameter names for StarfitFlowNodeMaker.

Return type:

tuple