| Knowledgebase Home | Contact |
| I have data in a matrix form. How can I use this to create a map? | |||||||||
You will need to convert the matrix to a grid file to make maps in Surfer. You can do this either by: 1. Converting the matrix to a DAT file and gridding the DAT You can take a look at the example script Matrix2XYZ.bas on our website (http://www.goldensoftware.com/scripts-S.shtml#S-10). It converts a worksheet in matrix format to an XYZ data file. From there you can use Grid | Data in Surfer to grid the data. I recommend gridding the data using the Nearest Neighbor gridding method, setting the Spacing value to be equal to the spacing in the data file. 2. Converting the matrix directly to an ASCII grid file. This is probably more accurate. An ASCII grid file has a 5 line header followed by a list of Z values, from left to right, bottom to top. If the grid file is reversed in either the X or Y direction (depending on the data listing in the matrix file), then reverse the grid file so that the X or Y data is going the right direction. To do this: a. Save your data in a text file. b. Open it in Notepad and add the 5-line header at the very top. The 5-line header is simply: DSAA # of lines in X # of lines in Y Xmin Xmax Ymin Ymax Zmin Zmax c. Go to File | Save As and save it with a .grd extension (put the name in quotes "testgrid.grd"). d. This will be in the correct format, except that the X or Y data may be reversed. If this is the case, go to Grid | Transform, select the grid file and click Open. e. In the Grid Transform dialog, select either the Mirror X or the Mirror Y as the Operation, and click OK. This is the grid with the data in the correct orientation. |
| Visitor Comments |
| No visitor comments posted. Post a comment |
| Attachments |
| No attachments were found. |