Tools for reading, writing, visualizing, and versioning EPA SWMM5 models.
Project description
SWMMIO is a set of python tools for interacting with and visualizing results from EPA Stormwater Management Model input and output files (.inp and .rpt). These tools are being developed specifically for the application of flood risk management.
Prerequisites
Usage:
In IDLE, add the directory holding the SWMMIO python scripts to your sys.path variable and import the modules:
import sys sys.path.append('/path/to/swmmio directory') import swmmio import swmm_graphics as sg from swmmio.utils import swmm_utils as su import swmm_compare as scomp
Instantiate some model objects by pointing SWMMIO to a directory containing a model’s .inp and .rpt files:
model_a = swmmio.model('/path/to/directory with swmm files') model_b = swmmio.model('/path/to/other/directory with swmm files')
sg.drawModel(model_a)
Create an animated gif of a model’s response to a storm. Again many options can be passed.
sg.animateModel(model_a, startDtime='JAN-01-1990 11:59:00', endDtime='JAN-01-1990 12:01:00')
scomp.comparisonReport(model_a, model_b)
Create visualization of the impact of a given alternative with respect to the baseline conditions.
scomp.drawModelComparison(model_a, model_b, options={'conduitSymb':'compare_hgl'})
Export organized data collected from the inp and rpt files as follows. By default, node data is returned; optionally, conduit data can be returned. As in all methods, a bounding box (bbox) option can be passed to spatially filter data.
model_a.exportData() model_a.exportData(type='conduit') #filter data within a bounding box boundingBox = ((2685990, 219185), (2692678, 223831)) model_a.exportData(bbox=boundingBox)
Acknowledgments
For use in generating animations of SWMM models, thanks to images2gif.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.