Surfer 6 Text Grid Format

Surfer 6 text grid files .GRD contain five header lines that provide information about the size and limits of the grid, followed by a list of Z values. The fields within ASCII grid files must be space or tab delimited.

The listing of Z values follows the header information in the file. The Z values are stored in row-major order starting with the minimum Y coordinate. The first Z value in the grid file corresponds to the lower left corner of the map. This can also be thought of as the southwest corner of the map, or, more specifically, the grid node of minimum X and minimum Y. The second Z value is the next adjacent grid node in the same row (the same Y coordinate but the next higher X coordinate). When the maximum X value is reached in the row, the list of Z values continues with the next higher row, until all the rows of Z values have been included.

The general format of an ASCII grid file is:

      id The identification string DSAA that identifies the file as an ASCII grid file.
  nx nx is the integer number of grid lines along the X axis (columns)
    ny is the integer number of grid lines along the Y axis (rows)
  xlo xlo is the minimum X value of the grid
    xhi is the maximum X value of the grid
  ylo ylo is the minimum Y value of the grid
    yhi is the maximum Y value of the grid
  zlo zlo is the minimum Z value of the grid. Blanked nodes are not included in the minimum.
    zhi is the maximum Z value of the grid. Blanked nodes are not included in the maximum. Note that if all nodes are blanked, the zlo=zhi= 1.71041e38.
  grid row 1
  grid row 2
  grid row 3
  These are the rows of Z values of the grid, organized in row order. Each row has a constant Y coordinate. Grid row 1 corresponds to ylo and the last grid row corresponds to yhi. Within each row, the Z values are arranged from xlo to xhi. Blank values appear as 1.71041e38.

 

Example

The following example grid file is ten rows high by ten columns wide. The first five lines of the file contain header information. X ranges from 0 to 9, Y ranges from 0 to 7, and Z ranges from 25 to 97.19. The first Z value shown corresponds to the lower left corner of the map and the following values correspond to the increasing X positions along the bottom row of the grid file. This file has a total of 100 Z values.

DSAA

10 10 

0.0 9.0

0.0 7.0

25.00 97.19

91.03 77.21 60.55 46.67 52.73 64.05 41.19 54.99 44.30 25.00

96.04 81.10 62.38 48.74 57.50 63.27 48.67 60.81 51.78 33.63

92.10 85.05 65.09 53.01 64.44 65.64 52.53 66.54 59.29 41.33

94.04 85.63 65.56 55.32 73.18 70.88 55.35 76.27 67.20 45.78

97.19 82.00 64.21 61.97 82.99 80.34 58.55 86.28 75.02 48.75

91.36 78.73 64.05 65.60 82.58 81.37 61.16 89.09 81.36 54.87

86.31 77.58 67.71 68.50 73.37 74.84 65.35 95.55 85.92 55.76

80.88 75.56 74.35 72.47 66.93 75.49 86.39 92.10 84.41 55.00

74.77 66.02 70.29 75.16 60.56 65.56 85.07 89.81 74.53 51.69

70.00 54.19 62.27 74.51 55.95 55.42 71.21 74.63 63.14 44.99

See Also

Surfer 6 Binary Grid File Format

Surfer 7 Grid File Format

File Format Chart