GMS:Data Set Files

From XMS Wiki - http://wikis.aquaveo.com/xms/

Jump to: navigation, search

Contents

ASCII Data Set Files

Data sets can be stored to either ASCII or binary files. The default format is binary. Data sets can be saved in ASCII format by right clicking on the data set in the Project Explorer and selecting the Export command from the pop up menu. For both file formats, multiple data sets can be stored in a single file and both scalar and vector data sets can be saved to the same file. The file format is identical for 2D and 3D data sets.

For scalar data set files, one value is listed per vertex, cell, node, or scatter point. The points are listed sequentially in ascending order according to the ids of the nodes, points, vertices, or cells. For vector data set files, one set of XYZ vector components is listed per vertex, cell, node, or scatter point. If necessary, a set of status flags can be included in the file. If the status flag is false (0), the corresponding item (node, cell, etc.) is inactive. If status flags are not included in the file, it is assumed that all items are active.

The ASCII Data Set file format is as follows:


DATASET // File type identifier

OBJTYPE type // Type of object data set is associated with

REFTIME reftime // A value corresponding to beginning date/time of dataset

BEGSCL // Beginning of scalar data set

OBJID id // Object id

ND numdata // Number of data values

NC numcells // Number of cells or elements

NAME "name" // Data set name

ACTTS time // Marks the active time step

MAPTS time // Marks the time step which is mapped as elevations

TS istat time // Time step of the following data

stat1 // Status flags

stat2

.

.

statnumcells

val1 // Scalar data values

val2

.

.

valnumdata

// Repeat TS card for each time step

ENDDS // End of data set

BEGVEC // Beginning of vector dataset

VECTYPE type // Vector at node/gridnode or element/cell

OBJID id // Object id

ND numdata // Number of data values

NC numcells // Number of cells or elements

NAME "name" // Data set name

TS istat time // Time step of the following data

stat1 // Status flags

stat2

.

.

statnumcells

vx1 vy1 vz1

vx2 vy2 vz2

.

.

vnumdata vnumdata vnumdata

// Repeat TS card for each time step

ENDDS // End of data set

// Repeat BEGSCL and BEGVEC sequences for each data set

Sample ASCII Data Set File:

DATASET

OBJTYPE grid2d

REFTIME 945.348729

BEGSCL

ACTTS 1.00000000e+00

ND 8

NC 8

NAME "trichloroethylene"

TS 1 1.00000000e+00

0

0

0

1

1

1

1

0

0.00000000e+00

0.00000000e+00

0.00000000e+00

3.24000000e+00

4.39000000e+00

2.96000000e+00

7.48000000e+00

0.00000000e+00

ENDDS

BEGVEC

VECTYPE 0

ND 8

NC 8

NAME "velocity"

TS 1 5.00000000e+00

0

0

0

1

1

1

1

0

1.60000000e+01 1.60000000e+01 3.20000000e+01

6.40000000e+01 6.40000000e+01 1.28000000e+02

1.44000000e+02 1.44000000e+02 2.88000000e+02

1.96000000e+02 1.96000000e+02 3.92000000e+02

2.25000000e+02 2.25000000e+02 4.50000000e+02

9.21600000e+03 9.21600000e+03 1.84320000e+04

9.60400000e+03 9.60400000e+03 1.92080000e+04

9.80100000e+03 9.80100000e+03 1.96020000e+04

ENDDS

If variograms have been defined for a data set or time step of a data set within GMS, the variograms are saved in the data set file. The variogram cards are not documented.

The card types used in the scalar data set file format are as follows:

Card Type DATASET
DecriptionFile type identifier. Must be on first line of file. No fields.
RequiredYES


Card Type OBJTYPE
DecriptionIdentifies the type of objects that the data sets in the file are associated with.
RequiredYES. 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.
FormatOBJTYPE type
SampleOBJTYPE tin


Field Variable Value Description
1typetinTINs
mesh2d2D meshes
grid2d2D grids
scat2d2D scatter points
mesh3d3D meshes
grid3d3D grids
scat3d3D scatter points


Card Type REFTIME
DecriptionA value corresponding to the beginning date/time of the data set.
RequiredNO
FormatREFTIME reftime
SampleREFTIME 3982.897459
Field Variable Value Description
1reftime" +/- "A value corresponding to the beginning date/time of the data set.


Card Type BEGSCL
DecriptionScalar data set file identifier. Marks beginning of scalar data set. No fields.
RequiredYES


Card Type BEGVEC
DecriptionVector data set file identifier. Marks beginning of vector data set. No fields.
RequiredYES


Card Type ACTTS
DecriptionUsed to mark the active data set. The card should be placed after the BEGSCL or BEGVEC card of the active data set and the active time step should be listed.
RequiredNO
FormatACTTS time
SampleACTTS 0.00
Field Variable Value Description
1time" +/- "The time corresponding to the active time step. Use 0.0 for steady state data sets.


Card Type MAPTS
DecriptionUsed to mark the data set which is mapped to the object elevations. The card should be placed after the BEGSCL or BEGVEC card of the mapped data set and the mapped time step should be listed.
RequiredNO
FormatMAPTS time
SampleMAPTS 0.00
Field Variable Value Description
1time" +/- "The time corresponding to the mapped time step. Use 0.0 for steady state data sets.


Card Type OBJID
DecriptionThe unique id of the object the data set is associated with.
RequiredThis card is required for data sets associated with TINs and scatter point sets.
FormatOBJID id
SampleOBJID 2383
Field Variable Value Description
1id" + "The unique id of the object.


Card Type VECTYPE
DecriptionIdentifies the type of vector data that will be read and where to apply it.
RequiredThis 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.
FormatVECTYPE tpye
SampleVECTYPE 0
Field Variable Value Description
1type" 0,1 "0 = The vectors will be applied to the nodes/gridnodes. 1 = The vectors will be applied to the elements/cells


Card Type ND
DecriptionThe number of data values that will be listed per time step. This number should correspond to the total number of vertices, nodes, cells centers (cell-centered grid), cell corners (mesh-centered grid), maximum node id (meshes) or scatter points.
RequiredYES
FormatND numdata
SampleND 10098
Field Variable Value Description
1numdata" + "The number of items. At each time step, numdata values are printed.


Card Type NC
DecriptionThis number should correspond to the maximum element id (meshes) or the number of cells (grids).
RequiredYES
FormatNC numcells
SampleNC 3982
Field Variable Value Description
1numcells" + "The number of elements or cells


Card Type NAME
DecriptionThe name of the data set
RequiredYES
FormatNAME "name"
SampleNAME "Total head"
Field Variable Value Description
1"name"strThe name of the dataset in double quotes.


Card Type TS
DecriptionMarks the beginning of a new time step, indicates if stat flags are given, and defines the time step value, status flags, and scalar data values for each item.
RequiredYES
Format

TS istat time stat1 stat2 . . stat numcells val1 val2 . . valnumdata

Sample

TS 1 12.5 0 1 1 1 34.5 74.3 58.4 72.9

Field Variable Value Description
1istat0,1-
2time+The time step value. If only one time step exists, the time is not required
3 - (nd+2)stat0,1The status of each item. If active, stat=1. If inactive stat=0. Omitted if i=0 on STAT card.
(nd+2) - (2nd+2)val" +/- "The scalar data values of each item


CardtypeENDDS
DescriptionMarks the end of a scalar opr vector data set. No fields
RequiredYES


Binary Data Set Files

Data sets saved with a GMS project are saved in the binary format. 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. The card ids are four byte integers. The binary format is as follows:

Card Item Size Description
version 4 byte integer The GMS binary data set file format version. value = 3000.
100object type4 byte integerIdentifies the type of objects that the data sets in the file are associated with. Options are as follows:
 1 TINs
 2 Boreholes
 3 2D meshes
 4 2D grids
 5 2D scatter points
 6 3D meshes
 7 3D grids
 8 3D scatter points
110SFLT4 byte integerThe number of bytes that will be used in the remainder of the file for each floating point value (4, 8, or 16).
120SFLG4 byte integerThe number of bytes that will be used in the remainder of the file for status flags.
130 or 140BEGSCL or BEGVEC Marks the beginning of a set of cards defining a scalar or vector data set.
220ACTTSSFLT realMarks the active data set and time step
230MAPTSSFLT realMarks the mapped data set and time step
150VECTYPE4 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.
160OBJID4 byte integerThe id of the associated object. Value is ignored for grids and meshes.
170NUMDATA4 byte integerThe 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.
180NUMCELLS4 byte integerThis number should correspond to the number of elements (meshes) or the number of cells (mesh-centered grids). Value is ignored for other object types.
190NAME40 bytesThe name of the dataset. Use one character per byte. Mark the end of the string with the '\0' character.
195REFTIME8 bytesA value corresponding to the beginning date/time of the data set.
200TS Marks the beginning of a time step.
ISTATSFLG integer(0 or 1) Indicates whether or not status flags will be included in the file.
TIMESFLT realTime corresponding to the time step.
statflag1SFLG integerStatus flag (0 or 1) for node 1
statflag2SFLG integerStatus flag (0 or 1) for node 2
...
val1SFLT realScalar value for item 1
val2SFLT realScalar value for item 2
...
Repeat card 200 for each timestep in the data set.
210ENDDS Signal the end of a set of cards defining a data set.

The cards in the binary data set file are as follows:

Card TypeVersion
Card Id3000
DescriptionFile type identifier. No fields.
RequiredYes
Card TypeObjType
Card Id100
DescriptionIdentifies the type of objects that the data sets in the file are associated with.
RequiredYES. 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.
FeildVariableSizeValueDescription
1id4 byte int1,2,3,4,5,6,7,8, TINs, Boreholes, 2D meshes, 2D grids, 2D scatter points, 3D meshes, 3D grids, 3D scatter points


Using Vector and Scalar Data with Grids

For meshes, TINs, and scatter point sets, the order that the values are listed in the file is simply the sequential order of the node, TIN, or scatter point ids. However, vector and scalar data can also be associated with the nodes or cells of a 2D or 3D grid. T For 2D grids, data values are ordered using a row-column (I-J) priority. For 3D grids, data values are ordered using a layer-row-column (K-I-J) priority.

The following C source code examples illustrate how a 2D or 3D array of scalar values corresponding to the nodes of a grid would be written to the main portion of an ASCII scalar file.

2D Grid Example:

for(i=0; i<nrow; i++){

for(j=0; j<ncol; j++){

fprintf(fp, "%f\n", scalar[i][j]);

}

}

3D Grid Example:

for(k=0; k<nlay; k++){

for(i=0; i<nrow; i++){

for(j=0; j<ncol; j++){

fprintf(fp, "%f\n", scalar[k][i][j]);

}

}

}


Related Links

Personal tools
XMS Projects