WMS:Binary Dataset Files
From XMS Wiki
Jump to navigationJump to search
Data sets can be stored to either ASCII or binary files. Compared to ASCII files, binary files require less memory and can be imported to WMS more quickly. The disadvantages of binary files are that they are not as portable and they cannot be viewed with a text editor.
The binary data set file format is shown in Figure 1. The binary format is patterned after the ASCII format in that the data are grouped into "cards". However, the cards are identified by a number rather than a card title.
Card | Item | Size | Description | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
version | 4 byte integer | The WMS binary data set file format version. value = 3000. | ||||||||||||||||||||
100 | objecttype | 4 byte integer | Identifies the type of objects that the data sets in the file are associated with. Options are as follows:
| |||||||||||||||||||
110 | SFLT | 4 byte integer | The number of bytes that will be used in the remainder of the file for each floating point value (4, 8, or 16). | |||||||||||||||||||
120 | SFLG | 4 byte integer | The number of bytes that will be used in the remainder of the file for status flags. | |||||||||||||||||||
130 or 140 | BEGSCL or BEGVEC | Marks the beginning of a set of cards defining a scalar or vector data set. | ||||||||||||||||||||
150 | VECTYPE | 4 byte integer | (0 or 1) In the case of vector data set files, indicates whether the vectors will be applied at the nodes/gridnodes or the elements/cells. | |||||||||||||||||||
160 | OBJID | 4 byte integer | The id of the associated object. Value is ignored for grids and meshes. | |||||||||||||||||||
170 | NUMDATA | 4 byte integer | The number of data values that will be listed per time step. This number should correspond to the number of vertices, nodes, cell centers (cell-centered grid), cell corners (mesh-centered grid) or scatter points. | |||||||||||||||||||
180 | NUMCELLS | 4 byte integer | This number should correspond to the number of elements (meshes) or the number of cells (mesh-centered grids). Value is ignored for other object types. | |||||||||||||||||||
190 | NAME | 40 bytes | The name of the dataset. Use one character per byte. Mark the end of the string with the ‘\0’ character. | |||||||||||||||||||
200 | TS | Marks the beginning of a time step. | ||||||||||||||||||||
ISTAT | SFLG integer | (0 or 1) Indicates whether or not status flags will be included in the file. | ||||||||||||||||||||
TIME | SFLT real | Time corresponding to the time step. | ||||||||||||||||||||
statflag1 | SFLG integer | Status flag (0 or 1) for node 1 | ||||||||||||||||||||
statflag2 | SFLG integer | Status flag (0 or 1) for node 2 | ||||||||||||||||||||
.... | ||||||||||||||||||||||
val1 | SFLT real | Scalar value for item 1 | ||||||||||||||||||||
val2 | SFLT real | Scalar value for item 2 | ||||||||||||||||||||
.... | ||||||||||||||||||||||
Repeat card 200 for each timestep in the data set. | ||||||||||||||||||||||
210 | ENDDS | Signal the end of a set of cards defining a data set. |
Figure 1. The Binary Scalar or Vector Data Set File Format.
The cards in the binary data set file are as follows:
Card Type | VERSION |
Card ID | 3000 |
Description | File type identifier. No fields. |
Required | YES |
Card Type | OBJTYPE | |||||||||||||||||||
Card ID | 100 | |||||||||||||||||||
Description | Identifies the type of objects that the data sets in the file are associated with. | |||||||||||||||||||
Required | YES. If card does not exist, the file can only be read through the Data Browser. The data sets would then be assigned to the objects corresponding to the active module. | |||||||||||||||||||
Field | Variable | Size | Value | Description | ||||||||||||||||
1 | id | 4 byte int |
|
|
Card Type | SFLT | |||
Card ID | 110 | |||
Description | Identifies the number of bytes that will be used in the remainder of the file for each floating point value (4, 8, or 16). | |||
Required | YES | |||
Field | Variable | Size | Value | Description |
1 | sizefloat | 4 byte int | 4, 8, or 16 | Number of bytes |
Card Type | SFLG | |||
Card ID | 120 | |||
Description | Identifies the number of bytes that will be used in the remainder of the file for status flags (1, 2, or 4). | |||
Required | YES | |||
Field | Variable | Size | Value | Description |
1 | sizeflag | 4 byte int | 1, 2, or 4 | Number of bytes |
Card Type | BEGSCL |
Card ID | 130 |
Description | Marks the beginning of a set of cards defining a scalar data set. |
Required | YES |
Card Type | BEGVEC |
Card ID | 140 |
Description | Marks the beginning of a set of cards defining a vector data set. |
Required | YES |
Card Type | VECTYPE | |||||||
Card ID | 150 | |||||||
Description | Identifies the type of vector data that will be read and where to apply it. | |||||||
Required | This card is only required if the vector data is associated with elements/cells. If this card is not present, it is assumed that the data are associated with nodes/gridnodes. | |||||||
Field | Variable | Size | Value | Description | ||||
1 | type | 4 byte int |
|
|
Card Type | OBJID | |||
Card ID | 160 | |||
Description | The id of the associated object. | |||
Required | This card is required in the case of TINs, 2D scatter points, and 3D scatter points. With each of these objects, multiple objects may be defined at once. Hence the id is necessary to relate the data set to the proper object. | |||
Field | Variable | Size | Value | Description |
1 | id | 4 byte int | + | The id of the object. |
Card Type | NUMDATA | |||
Card ID | 170 | |||
Description | The number of data values that will be listed per time step. This number should correspond to the number of vertices, nodes, cell centers (cell-centered grid), cell corners (mesh-centered grid), maximum node id (meshes) or scatter points. | |||
Required | YES | |||
Field | Variable | Size | Value | Description |
1 | numdata | 4 byte int | + | The number of items. At each timestep, numdata are listed. |
Card Type | NUMCELLS | |||
Card ID | 180 | |||
Description | This number should correspond to the element id (meshes) or the number of cells (grids). | |||
Required | YES | |||
Field | Variable | Size | Value | Description |
1 | numcells | 4 byte int | + | The number of elements or cells. |
Card Type | NAME | |||
Card ID | 190 | |||
Description | The name of the data set. | |||
Required | YES | |||
Field | Variable | Size | Value | Description |
1 | name | 40 bytes | str | The name of the data set. Use one character per byte. Mark the end of the string with the ‘\0’ character. |
Card Type | TS | |||||||||
Card ID | 200 | |||||||||
Description | Defines the set of scalar values associated with a timestep. Should be repeated for each time step. | |||||||||
Required | YES | |||||||||
Field | Variable | Size | Value | Description | ||||||
1 | istat | SFLG int |
|
| ||||||
2 | time | SFLT int | + | The time step value. This number is ignored if there is only one time step. | ||||||
stat | SFLG int |
|
| |||||||
val | SFLT real | ± | The scalar values |
Card Type | ENDDS |
Card ID | 210 |
Description | Signals the end of a set of cards defining a data set |
Required | YES |
WMS – Watershed Modeling System | ||
---|---|---|
Modules: | Terrain Data • Drainage • Map • Hydrologic Modeling • River • GIS • 2D Grid • 2D Scatter | |
Models: | CE-QUAL-W2 • GSSHA • HEC-1 • HEC-HMS • HEC-RAS • HSPF • MODRAT • NSS • OC Hydrograph • OC Rational • Rational • River Tools • Storm Drain • SMPDBK • SWMM • TR-20 • TR-55 | |
Toolbars: | Modules • Macros • Units • Digitize • Static Tools • Dynamic Tools • Drawing • Get Data Tools | |
Aquaveo |