Output.node_series#

Output.node_series(index, attribute, start_index=None, end_index=None)[source]#

Get node time series results for particular attribute. Specify series start index and end index to get desired time range.

Note: you can use pandas to convert dict to a pandas Series object with dict keys as index

Parameters:
  • index (Union[int, str]) – node index or name

  • attribute (swmm.toolkit.shared_enum.NodeAttribute) – attribute from swmm.toolkit.shared_enum.NodeAttribute: INVERT_DEPTH, HYDRAULIC_HEAD, PONDED_VOLUME, LATERAL_INFLOW, TOTAL_INFLOW, FLOODING_LOSSES, POLLUT_CONC_0

  • start_index (Union[int, datetime, None], optional) – start datetime or index from which to return series, defaults to None

  • end_index (Union[int, datetime, None], optional) – end datetime or index from which to return series, defaults to None

Returns:

dict of attribute values with between start_index and end_index with reporting timesteps as keys

Return type:

dict {datetime : value}

Examples:

>>> from swmm.toolkit.shared_enum import NodeAttribute
>>> from datetime import datetime
>>> from pyswmm import Output
>>>
>>> with Output('tests/data/model_full_features.out') as out:
...     ts = out.node_series('J1', NodeAttribute.INVERT_DEPTH, datetime(2015, 11, 1, 15), datetime(2015, 11, 1, 16))
...     for index in ts:
...         print(index, ts[index])
>>> 2015-11-01 15:00:00 15.0
>>> 2015-11-01 15:01:00 15.0
>>> 2015-11-01 15:02:00 15.0
>>> 2015-11-01 15:03:00 15.0