SMS:Binary Dataset Files *.dat: Difference between revisions
From XMS Wiki
Jump to navigationJump to search
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Datasets can be stored to either [[SMS:ASCII Data Set Files (*.dat)|ASCII]] or binary files. Compared to ASCII files, binary files require less memory and can be imported to SMS 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 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. | |||
Dataset files are opened through File | Open and are saved when other files are saved such as [[SMS:2D Scatter Point Files (*.xy)|2D Scatter Point Files]]. | |||
=File Format= | =File Format= | ||
Line 15: | Line 15: | ||
|version | |version | ||
|4 byte integer | |4 byte integer | ||
|The SMS binary | |The SMS binary dataset file format version. | ||
value = 3000 | value = 3000 | ||
|-valign="top" | |-valign="top" | ||
Line 21: | Line 21: | ||
|objecttype | |objecttype | ||
|4 byte integer | |4 byte integer | ||
|Indentifies the type of objects that the | |Indentifies the type of objects that the datasets in the file are associated with. Options are as follows: | ||
{| | {| | ||
|width="50"|1 | |width="50"|1 | ||
Line 56: | Line 56: | ||
|VECTYPE | |VECTYPE | ||
|4 byte integer | |4 byte integer | ||
|(0 or 1) In the case of vector | |(0 or 1) In the case of vector dataset files, indicates whether the vectors will be applied at the nodes/gridnodes or the elements/cells. | ||
|-valign="top" | |-valign="top" | ||
|160 | |160 | ||
Line 108: | Line 108: | ||
| | | | ||
|- | |- | ||
|colspan="4" style="text-align:center"|Repeat card 200 for each | |colspan="4" style="text-align:center"|Repeat card 200 for each time step in the dataset. | ||
|-valign="top" | |-valign="top" | ||
|210 | |210 | ||
|ENDDS | |ENDDS | ||
| | | | ||
|Signal the end of a set of cards defining a | |Signal the end of a set of cards defining a dataset. | ||
|- | |- | ||
|240 | |240 | ||
Line 161: | Line 161: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Colspan="4"|Identifies the type of objects that the | |Colspan="4"|Identifies the type of objects that the datasets in the file are associated with. | ||
|- | |- | ||
|''Required'' | |''Required'' | ||
Line 266: | Line 266: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Marks the beginning of a set of | |Marks the beginning of a set of cards defining a scalar dataset. | ||
|- | |- | ||
|''Required''||Colspan="3" style="text-align:left"|YES | |''Required''||Colspan="3" style="text-align:left"|YES | ||
Line 280: | Line 280: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Marks the beginning of a set of cards defining a vector | |Marks the beginning of a set of cards defining a vector dataset. | ||
|- | |- | ||
|''Required''||Colspan="3" style="text-align:left"|YES | |''Required''||Colspan="3" style="text-align:left"|YES | ||
Line 295: | Line 295: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Colspan="4"|Identifies the type of vector data | |Colspan="4"|Identifies the type of vector data that will be read and where to apply it. | ||
|- | |- | ||
|''Required''||Colspan="4" style="text-align:left"|YES. If card does not exist, the | |''Required''||Colspan="4" style="text-align:left"|YES. If card does not exist, the file can only be read through the Data Browser. The datasets would then be assigned to the objects corresponding to the active module. | ||
|- | |- | ||
| ''Field'' | | ''Field'' | ||
Line 334: | Line 334: | ||
|Colspan="4"|The id of the associated object. | |Colspan="4"|The id of the associated object. | ||
|- | |- | ||
|''Required''||Colspan="4" style="text-align:left"|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 | |''Required''||Colspan="4" style="text-align:left"|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 dataset to the proper object. | ||
|- | |- | ||
|''Field''||''Variable''||''Size''||''Value''||''Description'' | |''Field''||''Variable''||''Size''||''Value''||''Description'' | ||
Line 358: | Line 358: | ||
|''Field''||''Variable''||''Size''||''Value''||''Description'' | |''Field''||''Variable''||''Size''||''Value''||''Description'' | ||
|- | |- | ||
|1||numdata||4 byte int||+||The number of items. At each | |1||numdata||4 byte int||+||The number of items. At each time step, numdata are listed. | ||
|} | |} | ||
Line 398: | Line 398: | ||
|''Field''||''Variable''||''Size''||''Value''||''Description'' | |''Field''||''Variable''||''Size''||''Value''||''Description'' | ||
|- | |- | ||
|1||name||40 bytes||str||The name of the | |1||name||40 bytes||str||The name of the dataset. Use one character per byte. Mark the end of the string with the '\0' character. | ||
|} | |} | ||
Line 411: | Line 411: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Colspan="4"|Defines the set of scalar values associated with a | |Colspan="4"|Defines the set of scalar values associated with a time step. Should be repeated for each time step. | ||
|- | |- | ||
|''Required'' | |''Required'' | ||
Line 475: | Line 475: | ||
|- | |- | ||
|''Description'' | |''Description'' | ||
|Signals the end of a set of cards defining a | |Signals the end of a set of cards defining a dataset | ||
|- | |- | ||
|''Required''||YES | |''Required''||YES | ||
Line 554: | Line 554: | ||
= Related Topics = | = Related Topics = | ||
* [[SMS:File Formats|File Formats]] | * [[SMS:File Formats|File Formats]] | ||
* [[SMS:ASCII Data Set Files (*.dat)|ASCII | * [[SMS:ASCII Data Set Files (*.dat)|ASCII Dataset Files]] (*.dat) | ||
{{Template: | {{Template:Navbox SMS}} | ||
[[Category:SMS File Formats|B]] | [[Category:SMS File Formats|B]] |
Revision as of 16:50, 14 November 2012
Datasets can be stored to either ASCII or binary files. Compared to ASCII files, binary files require less memory and can be imported to SMS 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 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.
Dataset files are opened through File | Open and are saved when other files are saved such as 2D Scatter Point Files.
File Format
Card | Item | Size | Description | ||||||
version | 4 byte integer | The SMS binary dataset file format version.
value = 3000 | |||||||
100 | objecttype | 4 byte integer | Indentifies the type of objects that the datasets 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. | ||||||
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). | ||||||
130 or 140 | BEGSCL or BEGVEC | The number of bytes that will be used in the remainder of the file for status flags. | |||||||
150 | VECTYPE | 4 byte integer | (0 or 1) In the case of vector dataset 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 | |||||||
... | |||||||||
Repeat card 200 for each time step in the dataset. | |||||||||
210 | ENDDS | Signal the end of a set of cards defining a dataset. | |||||||
240 | RT_JULIAN | 8 byte float | The reference time as a Julian number. | ||||||
250 | TIMEUNITS | 4 byte integer | The time units as follows:
|
Cards
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 datasets 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. | |||||||||
Format | OBJTYPE type | |||||||||
Sample | OBJTYPE tin | |||||||||
Field | Variable | Size | Value | Description | ||||||
1 | type | 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 |
|
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
|
Number of bytes |
Card Type | BEGSCL | ||
Card ID | 130 | ||
Description | Marks the beginning of a set of cards defining a scalar dataset. | ||
Required | YES |
Card Type | BEGVEC | ||
Card ID | 140 | ||
Description | Marks the beginning of a set of cards defining a vector dataset. | ||
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 | YES. If card does not exist, the file can only be read through the Data Browser. The datasets would then be assigned to the objects corresponding to the active module. | |||||||
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 dataset 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 id of the associated object. | |||
Required | 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. | |||
Field | Variable | Size | Value | Description |
1 | numdata | 4 byte int | + | The number of items. At each time step, 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 dataset. 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 time step. 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 dataset |
Required | YES |
Card Type | RT_JULIAN | |||
Card ID | 240 | |||
Description | The reference time as a Julian number. | |||
Required | NO | |||
Field | Variable | Size | Value | Description |
1 | reference time | 8 byte float | +/- | Continuous count of days and fractions of days since noon Universal Time on January 1, 4713 BCE (on the Julian calendar). |
Card Type | TIMEUNITS | |||||||||
Card ID | 250 | |||||||||
Description | The time units. | |||||||||
Required | NO, but recommended | |||||||||
Field | Variable | Size | Value | Description | ||||||
1 | time units | 4 byte float |
|
|
Related Topics
- File Formats
- ASCII Dataset Files (*.dat)
SMS – Surface-water Modeling System | ||
---|---|---|
Modules: | 1D Grid • Cartesian Grid • Curvilinear Grid • GIS • Map • Mesh • Particle • Quadtree • Raster • Scatter • UGrid | |
General Models: | 3D Structure • FVCOM • Generic • PTM | |
Coastal Models: | ADCIRC • BOUSS-2D • CGWAVE • CMS-Flow • CMS-Wave • GenCade • STWAVE • WAM | |
Riverine/Estuarine Models: | AdH • HEC-RAS • HYDRO AS-2D • RMA2 • RMA4 • SRH-2D • TUFLOW • TUFLOW FV | |
Aquaveo • SMS Tutorials • SMS Workflows |