pywatershed.prms_channel_flow_graph_to_model_dict#
- pywatershed.prms_channel_flow_graph_to_model_dict(model_dict, prms_channel_dis, prms_channel_dis_name, prms_channel_params, new_nodes_maker_dict, new_nodes_maker_names, new_nodes_maker_indices, new_nodes_maker_ids, new_nodes_flow_to_nhm_seg, addtl_output_vars=None, graph_imbalance_behavior='defer', allow_disconnected_nodes=False, prms_channel_node_maker_name='prms_channel')[source]#
Add nodes to a PRMSChannel-based FlowGraph within a Model’s model_dict.
This function helps construct a
FlowGraphstarting from existing data for aPRMSChannelsimulation. The resulting FlowGraph is inserted into a model_dict used to instantiate aModel.One limitation is that this FlowGraph currently has no-inflow to non-PRMSChannel nodes (but this could be added/accomodated).
Note that if you want to run a
FlowGraphby itself, simply forced by known inflows (and not in the context of otherbase.Processes in aModel), then the helper functionprms_channel_flow_graph_postprocess()is for you.Please see the example notebook examples/06_flow_graph_starfit.ipynb which highlights both this helper function and
prms_channel_flow_graph_postprocess().- Parameters:
model_dict (
dict) – an existing model_dict to which to add the FlowGraphprms_channel_dis (
Parameters) – the PRMSChannel discretization objectprms_channel_dis_name (
str) – the name of the above discretization in the model_dict,prms_channel_params (
Parameters) – the PRMSChannel parameters object,new_nodes_maker_dict (
dict) – a dictionary of key/name and and instantiated NodeMakersnew_nodes_maker_names (
list) – collated list of what node makers to usenew_nodes_maker_indices (
list) – collated list of indices relative to each NodeMakernew_nodes_maker_ids (
list) – Collated list of ids relative to each NodeMaker.new_nodes_flow_to_nhm_seg (
list) – collated list describing the nhm_segs to which the new nodes will flow. Use of non-positive entries specifies the zero-based index for flowing to nodes specified in these collated parameters, allowing these new nodes to be added in groups, in series to the existing NHM FlowGraph. Note that a new node may not be placed below any outflow point of the domain.graph_imbalance_behavior (
Literal['defer',None,'warn','error']) – one of [“defer”, None, “warn”, “error”] with “defer” being the default and defering to control.options[“imbalance_behavior”] when available. When control.options[“imbalance_behavior”] is not avaiable, imbalance_behavior is set to “warn”.
- Return type:
- Returns:
A model dictionary.