Surfer 6 Binary Grid File Format
Surfer 6 grid files .GRD use a layout similar to the Surfer 6 Text grid format. The only difference is in the identification string and that Surfer 6 grid files are binary. Data types used in Surfer 6 grid files include:
Type |
Description |
char |
single byte |
short |
16 bit signed integer |
float |
32 bit single precision floating point value |
double |
64 bit double precision floating point value |
The Surfer 6 format has the following layout:
Element |
Type |
Description |
id |
char |
4 byte identification string ‘DSBB’ which identifies the file as aSurfer6binary grid file. |
nx |
short |
number of grid lines along the X axis (columns) |
ny |
short |
number of grid lines along the Y axis (rows) |
xlo |
double |
minimum X value of the grid |
xhi |
double |
maximum X value of the grid |
ylo |
double |
minimum Y value of the grid |
yhi |
double |
maximum Y value of the grid |
zlo |
double |
minimum Z value of the grid. NoData nodes are not included in the minimum. |
zhi |
double |
maximum Z value of the grid. NoData nodes are not included in the maximum. Note that if all nodes are assigned NoData, the zlo=zhi= 1.70141e38. |
z11, z12, … |
float |
first row of the grid. Each row has a constant Y coordinate. The first row corresponds to ylo, and the last row corresponds to yhi. Within each row, the Z values are ordered from xlo to xhi. NoData values appear as 1.70141e38. |
z21, z22, … |
float |
second row of the grid |
z31, z32, … |
float |
third row of the grid |
… |
float |
all other rows of the grid up to yhi |