Open-source · Python · Watershed Modeling
Hydrologic modeling
without the friction.
PyWMP automates the full pipeline — spatial data acquisition to flood map — in clean, Python-native code. 1D, 2D, hybrid coupling, calibration, coastal, sediment, water quality.
What PyWMP does¶
Automated data prep¶
Download DEM (3DEP 1–30 m), watershed boundaries, NHD stream network, NLCD land cover, SSURGO soil groups, composite CN rasters, NOAA Atlas 14, and FEMA flood zones — with one download_all() call.
1D hydrologic modeling¶
SCS CN and Green-Ampt losses. Clark, SCS, and Snyder unit hydrographs. Muskingum and kinematic wave routing. HEC-HMS–compatible multi-subbasin network.
2D floodplain simulation¶
Rain-on-mesh ROM solver over DEM-derived grids. HAND-based inundation depth mapping. Export to GeoTIFF and Cloud Optimized GeoTIFF for web sharing.
Hybrid 1D–2D coupling¶
Outlet-to-inflow-BC and excess-precip distribution modes. Combine 1D channel routing accuracy with 2D spatial flood extent in a single run.
Calibration & optimization¶
CalibrationEngine with differential evolution, Nelder-Mead, dual annealing, LHS, and grid search. NSE, KGE, PBIAS, RMSE objective functions. Morris and Sobol sensitivity.
Model validation¶
HydroMetrics for gauge-based skill scores. SpatialFloodValidation for raster extent comparison — CSI, hit rate, false alarm ratio, F1, area bias.
Coastal modeling¶
SeawallGeometry and storm surge routing. TC intensity estimator. SeawallSLRSweep for multi-scenario sea-level rise analysis across return periods.
Sediment transport¶
Bedload via Meyer-Peter–Müller. Cohesive suspended sediment. MorphodynamicBed for iterative bed evolution. Stokes settling velocity by particle class.
Water quality¶
TSS and total phosphorus transport coupled to 1D discharge. EMC lookup table for 25 NLCD classes. Sub-daily constituent loading estimation.
REST API & deployment¶
FastAPI server — submit HMS and Cascade runs, stream live progress over WebSocket, poll results. Upload .dat files. Docker Compose included, scale with --workers.