Batch Import Hydrographs into XPSWMM
A common scenario is using HEC-HMS to generate the hydrographs, then route the flow in XPSWMM. For models with hundreds of basins, it can be a tedious task copying hydrograph for each basin.
In this article, I will show an easy way to convert the hydrographs from a csv file into XPSWMM/XPSTORM using the XPX exchange format.
Step 1: Download the tool and install python
Anaconda makes installing python really easy. Here is the download link. Either 64-bit or 32-bit should work.
- Start “Spyder”
2. Prepare the csv file. As shown below, each column is a hydrograph for a node. The header should match XPSWMM node names exactly. The first column is the time stamp, and it should be called datetime and the format should look like the following. If you are familiar with python, read the comment in the script and update the date_format string to match your format.
This csv file can be easily created from HEC-HMS using HEC-DSSVue. Open the exported excel file and remove the extra rows and columns.
3. Open the downloaded python script, update the hydograph and xpx output paths, then hit the run button. This should generate the *.xpx file.
4. Import the xpx file into the XPSWMM/XPSTORM model
And that’s it, a very simple and quick way to get hydrographs exported from HEC-HMS into XPSWMM/XPSTORM.