Knowledgebase Home | Contact Knowledgebase Home| Contact
Search the Knowledgebase Browse by Category
How do I convert an ESRI ASCII grid file to a Surfer GRD file?
User Opinions
92% thumbs up 7% thumbs down

How would you rate this answer?
Helpful
Not helpful

Surfer 9 directly supports ESRI grid files. You can use the Grid | Convert command in Surfer 9 to convert an ESRI grid to a Surfer grid, or you can use the ESRI grid directly in Surfer 9 to create maps.

In Surfer 8, the easiest way to convert an ESRI grid file to a Surfer grid file is to use the script that does the conversion: http://www.goldensoftware.com/public/scripts/surfer8/arc2grd3.bas

If you would like to do the conversion manually, this is what the header of the ESRI file looks like:

 

ncols 4320
nrows 3827
xllcorner -83.167956096451
yllcorner 41.485325314883
cellsize 0.0010660181920425
NODATA_value
 -9999


Change the ESRI grid file header to the Surfer GS ASCII header:


DSAA            'Surfer ASCII GRD ID
nCols nRows     'number of columns and rows
xMin xMax       'XYZ min max
yMin yMax
zMin zMax
z11 z21 z31 ... 'List of Z values

 

The GS ASCII format requires the XYZ min max. Calculate the XY max from the XY min, the number of rows and columns, and the cellsize.


xMax = xMin + (0.5*cellsize) + (cellsize * (ncols-1))

yMax = yMin + (0.5*cellsize) + (cellsize * (nrows-1))

 

The XY min max should be adjusted by half the cell size because ESRI grids are based on the center of the grid cell and Surfer grids are based on grid lines which equate to the edges of a cell.

 

If you don't know the zMin and zMax, use 0 and 1 as placeholders for now. The values will be calculated automatically in a subsequent step.


DSAA
4620 3827
-83.167956096451 -83.1679561
41.485325314883 45.56391092
0 1


Use a text editor Find/Replace function or Grid | Math (after the grid has been saved) to replace the NODATA value with the Surfer blanking value of 1.70141e+38. Save the changes to an ASCII text format with the GRD extension.

The ESRI grid format lists the Z values from top to bottom of the map, and Surfer uses the reverse order. To fix the order (and get the Z min max as a side bonus), choose Grid | Transform, specify the GRD file, change the operation to Mirror Y, specify a new output GRD file name, and click OK. Create a map from the new GRD file.

Visitor Comments
No visitor comments posted. Post a comment
Related Questions
Attachments
No attachments were found.
Post Comment for "How do I convert an ESRI ASCII grid file to a Surfer GRD file?"
To post a comment for this question, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
Continue
Powered by ActiveKB Knowledgebase Software

Home * Products * Gallery * Support * About Us * Register * Order * Demos