RainGages#

class RainGages(model)[source]#

Rain Gages Iterator Methods.

Parameters:

model (object) – Open Model Instance

Examples:

>>> from pyswmm import Simulation, Nodes
>>>
>>> with Simulation('tests/data/TestModel1_weirSetting.inp') as sim:
...     for raingage in RainGages(sim):
...         print(raingage)
...         print(raingage.raingageid)
...
>>> <swmm5.RainGage object at 0x031B0350>
>>> Gage1
>>> <swmm5.RainGage object at 0x030693D0>
>>> Gage4
>>> <swmm5.RainGage object at 0x031B0350>
>>> Gage3
>>> <swmm5.RainGage object at 0x030693D0>
>>> Gage10

Iterating over Nodes Object

>>> raingages = RainGages(sim)
>>> for raingage in raingages:
...     print(raingage.raingageid)
>>> Gage1
>>> Gage4
>>> Gage3
>>> Gage10

Testing Existence

>>> raingages = RainGages(sim)
>>> "Gage1" in raingages
>>> True

Initializing a node Object

>>> raingages = RainGages(sim)
>>> gage1 = raingages['Gage1']
>>> print(gage1.total_precip)
>>> 0.04
>>>
>>> gage1.total_precip = 1
>>> print(gage1.total_precip)
>>> 1

Methods