HEC-HMS schematics in Versions 2.2.1 & 3.0.0
HEC-HMS schematics in Versions 2.2.1 & 3.0.0
(OP)
Harris County, TX requires the use of HEC-HMS version 2.2.1. So most of my HEC-HMS files are in version 2.2.1.
I thought I'd try out 3.0.0 and see if I liked it. Once I worked with or saved files in 3.0.0, and opened them back up in 2.2.1, the basin schematics were destroyed.
Using Notepad (text editor), I opened a .basin file from version 2.2.1 and a .basin file from 3.0.0 and hand-edited the 3.0.0 one to match the format of the 2.2.1 one, but it was extremely tedious. I had to delete the "latitude" and "longitude" lines from every single hydrologic element, and then I had to change the Canvas Y values from scientific format (1.3900000E7) to regular decimal format (13900000.000). I had to do this for EVERY single hydrologic element (my model has about 70).
Has anyone else had this problem? Is there an easy fix? Is there a macro or batch file out there that will do this automatically? Is there a way I could automate it a little bit using Excel or something? I had many scenarios saved in this file, so they all have different .basin files, and I'll have to modify each one by hand.
Katie
I thought I'd try out 3.0.0 and see if I liked it. Once I worked with or saved files in 3.0.0, and opened them back up in 2.2.1, the basin schematics were destroyed.
Using Notepad (text editor), I opened a .basin file from version 2.2.1 and a .basin file from 3.0.0 and hand-edited the 3.0.0 one to match the format of the 2.2.1 one, but it was extremely tedious. I had to delete the "latitude" and "longitude" lines from every single hydrologic element, and then I had to change the Canvas Y values from scientific format (1.3900000E7) to regular decimal format (13900000.000). I had to do this for EVERY single hydrologic element (my model has about 70).
Has anyone else had this problem? Is there an easy fix? Is there a macro or batch file out there that will do this automatically? Is there a way I could automate it a little bit using Excel or something? I had many scenarios saved in this file, so they all have different .basin files, and I'll have to modify each one by hand.
Katie





RE: HEC-HMS schematics in Versions 2.2.1 & 3.0.0
In the mean time, you could probably set up an Excel file to save your output into 2.1.1 format. You can save Excel files as formatted text files (.prn) where column width = number of characters (so a blank column of width 10 will transfer to ten spaces, or a text cell with 11 letters but width of 10 will only allow ten characters to transfer to the .prn file). You could format your number fields as Number with 3 decimal places (instead of scientific) and make sure the column is at least 12 points wide to ensure that you don't lose any digits.
RE: HEC-HMS schematics in Versions 2.2.1 & 3.0.0
I will try the Excel thing.
I am still curious if anyone else has run into this before. I haven't really checked to see if I could duplicate the problem intentionally, and I don't want to submit a bug report if it's just user error!
RE: HEC-HMS schematics in Versions 2.2.1 & 3.0.0
Subbasin: m112a
Description: da m112a hyd
Latitude Degrees: 0.0
Longitude Degrees: 0.0
Canvas X: 3049281.8
Canvas Y: 1.3970893E7
If you read it in as space delimited, you end up with two columns on the first row, 4 on the 2nd, 3 on the rest. Then if you save it as a .prn, there are tons of extra spaces, so the 2nd line would look something like:
Description: da m112a hyd
and it ends up messing everything up.
RE: HEC-HMS schematics in Versions 2.2.1 & 3.0.0
Going through the wizard, you want to select the following options:
Fixed Width (select next)
Now specify your columns in convenient locations:
5, 15 should do it.
After you hit "Finish," it'll look a little weird in Excel because you'll need to set your column widths.
Column A should be 5 points wide. Column B should be 10 points wide. Column C can be any width at this stage.
Next you want to format the number to be a number with three decimal places.
Once you've done that, you need to determine which is the longest string in the column (which has the most characters -- letters and spaces). In the example this is cell C2, which has 15 characters. We therefore need to set column C to a width of at least 15 - more won't hurt though.
The final step is to left-align your number fields (or all of column C). Now save your file as formatted text. (Answer yes to losing the formatting - that's the idea!) Close Excel (say no to saving your changes because you just saved the file exactly as you want it).
When you open it up in notepad or wordpad, it should look right.
You can probably record a macro to do this - the challenge might be formatting the number correctly, but if the Canvas X: number can have three decimal places, you could probably get away with formatting the whole C column to be a number with three decimal places. Excel should ignore that formatting for the text fields without any trouble.
RE: HEC-HMS schematics in Versions 2.2.1 & 3.0.0