Output.link_attribute¶
- Output.link_attribute(time, attribute=('flow_rate', 'flow_velocity', 'flow_depth'), asframe=True)[source]¶
For all links at a given time, get one or more attributes.
- Parameters:
- time: Union[str, int, datetime]
The datetime or simulation index for which to pull data, defaults to None.
- attribute: int | str | EnumMeta | Sequence[int | str | EnumMeta] | None
The attribute index or name.
On of:
flow_rate, flow_depth, flow_velocity, flow_volume, capacity,
defaults to (‘flow_rate’,’flow_velocity’,’flow_depth’)
Can also input the integer index of the attribute you would like to pull or the actual enum from Output.link_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:
- pd.DataFrame
A DataFrame of attribute values in each column for requested simulation time.
Examples
Pull depth. flooding, and total inflow attributes from end of simulation
>>> from swmm.pandas import Output,example_out_path >>> out = Output(example_out_path) >>> out.link_attribute(out.period/2) invert_depth flooding_losses total_inflow node JUNC1 8.677408 0.000000 2.665294 JUNC2 4.286304 0.000000 14.571551 JUNC3 11.506939 0.341040 2.319820 JUNC4 14.936149 16.137648 27.521870 JUNC5 11.190232 0.000000 9.051201 JUNC6 1.650765 0.000000 5.799996 OUT1 0.946313 0.000000 5.799996 OUT2 0.000000 0.000000 14.574173 STOR1 18.282972 0.000000 9.048394