Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
swmm-pandas
Logo
swmm-pandas
  • Installation
  • Usage
  • API Reference
    • Input
    • Output
      • Output.link_series
      • Output.node_series
      • Output.subcatch_series
      • Output.system_series
      • Output.link_attribute
      • Output.node_attribute
      • Output.subcatch_attribute
      • Output.system_attribute
      • Output.link_result
      • Output.node_result
      • Output.subcatch_result
      • Output.system_result
      • Output.getStructure
    • Report
    • Structure
      • swmm.pandas.output.Structure
      • Structure.out
      • Structure.link
      • Structure.node
      • Structure.flowFrame
      • Structure.floodFrame
      • Structure.flowEvents
      • Structure.floodEvents
Back to top
View this page

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
Next
Output.node_attribute
Previous
Output.system_series
Copyright © 2021, Constantine Karos
Made with Sphinx and @pradyunsg's Furo
Last updated on Oct 29, 2024
On this page
  • Output.link_attribute
    • Output.link_attribute()