Rain gages#
Note
Engine: OpenSWMM 6 — refactored.
Rain gages drive rainfall onto subcatchments. The shape mirrors
Nodes and Links — a collection on solver.gages that
yields Gage wrappers.
Reference: openswmm_gages.h.
Quickstart#
from openswmm.engine import Solver, GageDataSource, GageRainType
with Solver("model.inp") as s:
g = s.gages["RG1"]
print(g.rain_type, g.data_source)
# Read / inject runtime rainfall.
print(g.rainfall)
g.rainfall = 25.4
# Bulk numpy read across all gages.
arr = s.gages.rainfalls
Collection: Gages#
Operation |
What it does |
|---|---|
|
Gage count. |
|
Returns a |
|
Yields a fresh |
|
Id ↔ index lookup. |
|
Append a gage. Returns the |
|
Rename in place. Invalidates wrappers. |
|
|
|
|
Wrapper: Gage#
Property |
Type |
Mode |
Meaning |
|---|---|---|---|
|
|
read-only |
|
|
|
read-only |
|
|
|
read/write |
INTENSITY / VOLUME / CUMULATIVE. |
|
|
read/write |
TIMESERIES / FILE. |
|
|
read/write |
Runtime rainfall. |
Methods:
Method |
What it does |
|---|---|
|
Set the interval. Accepts |
|
Configure |
|
Configure |
The wrapper has no sub-views (gages are simple). Staleness and equality
follow the same model as Node / Link.
See also#
Running a simulation — Solver — where
s.gagescomes from.Subcatchments —
Subcatchment.gageyields aGage.