Output.node_attribute#
- Output.node_attribute(attribute, time_index=None)[source]#
For all nodes at given time, get a particular attribute.
- Parameters:
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
time_index (Union[int, datetime, None]) – datetime or simulation index, defaults to None
- Returns:
dict of attribute values for all nodes at given timestep
- Return type:
dict {node: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: ... data = out.node_attribute(NodeAttribute.INVERT_DEPTH, datetime(2015, 11, 1, 16)) ... for object in data: ... print(object, data[object]) >>> J1 15.0 >>> J3 1.9746614694595337 >>> J4 0.0 >>> J2 0.0009783204877749085