pywatershed.HruNodeFlowExchange#
- class pywatershed.HruNodeFlowExchange(control, discretization, parameters, sroff_vol, ssres_flow_vol, gwres_flow_vol, imbalance_behavior='defer', input_aliases=None, verbose=None)[source]#
Process to map PRMS HRU outflows to lateral inflows on nodes.
This class maps PRMS HRU outflows to
FlowGraphnode inflows in the context of aModel. To map HRU outflows to PRMS segments, seeHruSegmentFlowExchange.- __init__(control, discretization, parameters, sroff_vol, ssres_flow_vol, gwres_flow_vol, imbalance_behavior='defer', input_aliases=None, verbose=None)[source]#
Instantiate a HruNodeFlowExchange.
- Parameters:
discretization (
Parameters) – A discretizaion (Parameters) for PRMSChannel.parameters (
Parameters) – AParametersfor PRMSChannel.sroff_vol (
Union[str,Path,ndarray,Adapter,PrmsDynamicParameter]) – AnAdaptableof volumetric surface runoff.ssres_flow_vol (
Union[str,Path,ndarray,Adapter,PrmsDynamicParameter]) – AnAdaptableof volumetric subsurface reservoir flow.gwres_flow_vol (
Union[str,Path,ndarray,Adapter,PrmsDynamicParameter]) – AnAdaptableof volumetric groundwater reservoir flow.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”.verbose (
bool) – Boolean for the amount of messages to be printed.
Methods
__init__(control, discretization, ...[, ...])Instantiate a HruNodeFlowExchange.
advance()Advance the Process in time.
calculate(time_length, **kwargs)Calculate Process terms for a time step
A dictionary description of this Process.
finalize()Finalize the Process, output methods, and close input adapters.
Get a tuple of dimension names for this Process.
Get a dictionary of variable names for energy budget terms.
Get a dictionary of initialization values for each public variable.
Get a tuple of input variable names for this Process.
Get a dictionary of variable names for mass budget terms.
Get a tuple of parameter names for this Process.
A list of restart varible names.
Get a tuple of (public) variable names for this Process.
initialize_netcdf([output_dir, ...])Initialize NetCDF output.
output()Output data to previously initialized output types.
output_to_csv(pth)Save each output variable to separate csv file in specified path
set_input_to_adapter(input_variable_name, ...)Set input variables to adapter.current and manage the adapter.
Attributes
Legacy property for backward compatibility - returns mass budget.
A tuple of parameter names.
The energy budget for this process, if enabled.
A dictionary of variable names for the energy budget terms.
A dictionary of initial values for each public variable.
A tuple of input variable names.
The mass budget for this process, if enabled.
A dictionary of variable names for the mass budget terms.
A tuple of parameter names.
previous.
A tuple of public variable names.
- advance()#
Advance the Process in time.
- Returns:
None
- property budget#
Legacy property for backward compatibility - returns mass budget.
Deprecated since version The: ‘budget’ property is deprecated. Use ‘mass_budget’ instead.
- calculate(time_length, **kwargs)#
Calculate Process terms for a time step
- Parameters:
simulation_time – current simulation time
- Return type:
- Returns:
None
- classmethod description()#
A dictionary description of this Process.
- Return type:
- Returns:
All metadata for all variables in inputs, variables, parameters, mass_budget_terms, and energy_budget_terms for this Process.
- property energy_budget#
The energy budget for this process, if enabled.
- finalize()#
Finalize the Process, output methods, and close input adapters.
- Return type:
- Returns:
None
- classmethod get_energy_budget_terms()#
Get a dictionary of variable names for energy budget terms.
- Return type:
- static get_init_values()[source]#
Get a dictionary of initialization values for each public variable.
- Return type:
- classmethod get_variables()#
Get a tuple of (public) variable names for this Process.
- Return type:
- initialize_netcdf(output_dir=None, separate_files=None, budget_args=None, output_vars=None, extra_coords=None, addtl_output_vars=None)#
Initialize NetCDF output.
- Parameters:
output_dir ([<class ‘str’>, <class ‘pathlib.Path’>]) – base directory path or NetCDF file path if separate_files is True
separate_files (
bool) – boolean indicating if storage component output variables should be written to a separate file for each variableoutput_vars (
list) – list of variable names to output.
- Return type:
- Returns:
None
- property mass_budget#
The mass budget for this process, if enabled.
- output_to_csv(pth)#
Save each output variable to separate csv file in specified path
- set_input_to_adapter(input_variable_name, adapter)#
Set input variables to adapter.current and manage the adapter.
TODO: make this private?