If you have a data file that already contains gridded data, the following header can be placed in the file and the file directly imported into SURFER:
id
the code letters DSAA which identify the file as an ASCII grid file.
(note: DSAA must be in caps)
nx
ny
nx (integer) is the # of grid lines along the x axis (columns)
ny (integer) is the # of grid lines along the y axis (rows)
xlo xhi xlo min.
x value of the grid
xhi max. x value of the grid
ylo yhi ylo min.
y value of the grid
yhi max. y value of the grid
zlo zhi zlo min.
z value of the grid
zhi max. z value of the grid
grid row 1 z data.............................................
grid row 2 z data.............................................
etc.
these are the z values of the grid, organized in row order. The grid
row 1 corresponds to ylo and the last to yhi. (This means that the
first
line corresponds to the “south” end of the map). As long as the grid
values
in the file are ordered correctly from left to right, it does not
matter
how many entries there are per line. Thus, you can put a grid row on
one
or more lines, as long as the values are ordered consecutively.
For an example of the header, say you have generated a grid containing 11 rows and 6 columns. Edit the file by typing in the first five lines as described above (shown in bold italics):
DSAA
6 11
0 500
0 1000
100.0 104.0
100.0
100.9
101.3
101.5
101.6 101.5
100.9
101.3
101.5
101.7
101.8 101.8
101.6
101.7
101.9
102.0
102.0 102.0
102.1
102.1
102.2
102.3
102.3 102.3
102.5
102.5
102.6
102.6
102.6 102.6
102.8
102.9
103.2
102.9
102.8 102.8
103.0
103.1
103.2
103.1
103.1 103.0
103.2
103.2
103.3
103.2
103.2 103.2
103.4
103.4
103.4
103.4
103.4 103.4
103.5
103.5
103.5
103.5
103.6 103.7
103.6
103.7
103.6
103.6
103.7 104.0
download the file: example.grd
Save the file on disk. Next, once in SURFER, click on “MAP” and then “CONTOUR.” Find the file with the browse button and click OK. The next window will let you select the way you want to style your map. Click OK and the contour map should appear on the screen.
Note: you will probably want your grid to be mapped so that the
first
line of the file will be the “north” row and the last line the “south”
row. The row order can be reversed in the file editor or you can do
this
directly in SURFER (version 6 or higher). Choose GRID and then
TRANSFORM. Select your grid file and then choose “Mirror Y” as the
operation. The new file
(by default called “OUT.GRD”) will be oriented properly and can then be
contoured as needed. Here is the map using default SURFER's default
parameters:
