Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code documentation regarding generation of rainfall interface file formats #186

Open
cbuahin opened this issue Jul 25, 2024 Discussed in #185 · 0 comments
Open

Fix code documentation regarding generation of rainfall interface file formats #186

cbuahin opened this issue Jul 25, 2024 Discussed in #185 · 0 comments
Assignees
Milestone

Comments

@cbuahin
Copy link
Collaborator

cbuahin commented Jul 25, 2024

Discussed in #185

Originally posted by MitchHeineman July 24, 2024
I'd like to write a rainfall interface file outside of SWMM to facilitate use of hundreds or thousands of rain gages. The rain.c documentation explains the format, but I end up with an unreadable file. When I compare my file with one saved by SWMM, there appears to be a difference after the 14-byte file header and before the gage metadata section. Perhaps this stems from my misunderstanding of what is meant by "(MAXMSG+1 (=80) bytes)". Given that MAXMSG=1024, this would appear to be equivalent to (1025 (=80) bytes), which I cannot understand. Should the station ID be 80 bytes? Is the length of the gage metadata section 14 + 92 x number of gages? Should the starting byte for the first rain data record be 14 + 92g + 1? Is there example code that writes a rainfall interface file from a text rainfall file?

//   The layout of the SWMM binary rainfall interface file is:
//     File stamp ("SWMM5-RAIN") (10 bytes)
//     Number of SWMM rain gages in file (4-byte int)
//     Repeated for each rain gage:
//       recording station ID (not SWMM rain gage ID) (MAXMSG+1 (=80) bytes)
//       gage recording interval (seconds) (4-byte int)
//       starting byte of rain data in file (4-byte int)
//       ending byte+1 of rain data in file (4-byte int)
//     For each gage:
//       For each time period with non-zero rain:
//         Date/time for start of period (8-byte double)
//         Rain depth (inches) (4-byte float)
```</div>
@cbuahin cbuahin self-assigned this Jul 25, 2024
@cbuahin cbuahin added this to the v5.3.0 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant