Output#

class Output(binfile)[source]#

Output Methods. Base class for a SWMM Output binary file. The output object provides several options to process timeseries within output binary file.

Parameters:

binfile – model binary file path

Examples:

>>> from pyswmm import Output
>>>
>>> with Output('tests/data/model_full_features.out') as out:
...     print(len(out.subcatchments))
...     print(len(out.nodes))
...     print(len(out.links))
>>>
>>> 3
>>> 4
>>> 3

Initialize the Output class. :param binfile: model binary file path

Methods

close

Close an opened binary file

link_attribute

For all links at given time, get a particular attribute.

link_result

For a link at given time, get all attributes.

link_series

Get link time series results for particular attribute.

node_attribute

For all nodes at given time, get a particular attribute.

node_result

For a node at given time, get all attributes.

node_series

Get node time series results for particular attribute.

object_name

Get object name from SWMM output binary file using object index and object type

open

Open a binary file

subcatch_attribute

For all subcatchments at given time, get a particular attribute.

subcatch_result

For a subcatchment at given time, get all attributes.

subcatch_series

Get subcatchment time series results for particular attribute.

system_result

At a given time, get all system attributes.

system_series

Get system time series results for particular attribute.

verify_index

Validate the index of a model element passed to Output methods.

verify_time

Validate time parameter passed to Output methods.

Attributes

links

Return a dict of links stored in SWMM output binary file

nodes

Return a dict of nodes stored in SWMM output binary file

pollutants

Return a dict of pollutants stored in SWMM output binary file

project_size

Returns project size for model elements in the following order: [subcatchment, node, link, system, pollutant]

subcatchments

Return a dict of subcatchments stored in SWMM output binary file

times

Returns list of reporting timestep stored in model binary file

units

Return SWMM output binary file units for unit system, flow, and pollutants

version

Return SWMM version used to generate SWMM output binary file results