An exploratory project: reading and visualising HEC-RAS 1D steady-flow results in Python with the ras-commander library. It reads a plan's HDF output directly — no HEC-RAS installation or GUI required — and builds an annotated longitudinal profile with a flow-regime panel.
- Reads 1D steady-flow results straight from a HEC-RAS plan HDF file (
.p01.hdf) - Reconstructs hydraulic quantities the library returns empty, from first principles: channel invert (
bed = wsel − max_depth), energy grade line (E = wsel + V²/2g), Froude number (Fr = V / √(g·D),D = area / top_width) - Classifies flow regime per cross section (subcritical / critical / supercritical)
- Plots the longitudinal profile — bed, water surface, energy line, shaded depth — with a Froude panel below, marking where flow goes supercritical
This explores the library's read/visualisation capabilities; it isn't a finished tool. Running simulations (rather than reading finished results) is a separate, more involved step and is out of scope here.
Uses the public 1D Steady Flow example (Merced River, Yosemite Valley) from the official HEC-RAS tutorial. The model files are not included in this repo — download the zip from the tutorial and point the notebook at the .p01.hdf file:
Steady Flow Modeling with HEC-RAS
pip install -r requirements.txt
jupyter lab hecras_water_surface_profile.ipynbNo HEC-RAS installation needed — the notebook reads the HDF results directly, so it runs on Linux, macOS or Windows.
Python · pandas · NumPy · Matplotlib · ras-commander