swmm.pandas.Output.subcatch_attribute¶
-
Output.subcatch_attribute(time, attribute=
('rainfall', 'runoff_rate', 'gw_outflow_rate')
, asframe=True
)[source]¶ For all subcatchments at a given time, get a one or more attributes.
- Parameters
- time: Union[str, int, datetime]
The datetime or simulation index for which to pull data, defaults to None.
- attribute: Union[int, str, Enum, Sequence[Union[int, str, Enum]], None],
The attribute index or name.
On of:
rainfall, snow_depth, evap_loss, infil_loss, runoff_rate, gw_outflow_rate, gw_table_elev, soil_moisture.
Defaults to: (‘rainfall’,’runoff_rate’,’gw_outflow_rate’).
You can also input the integer index of the attribute you would like to pull or the actual enum from Output.subcatch_attributes.
Setting to None indicates all attributes.
- asframe: bool
A switch to return an indexed DataFrame. Set to False to get an array of values only, defaults to True.
- Returns
- Union[pd.DataFrame, np.ndarray]
A DataFrame or ndarray of attribute values in each column for requested simulation time.
Examples
Pull rainfall for all catchments at start of simulation
>>> from swmm.pandas import Output,test_out_path >>> out = Output(test_out_path) >>> out.subcatch_attribute(0,'rainfall') rainfall subcatchment SUB1 0.03 SUB2 0.03 SUB3 0.03