Data Files

Data files contain the raw information used to create a grid file, perform residual calculations, or produce post maps. Each record in a data file occupies a single row and is comprised of at least two values (X, Y) for post maps and at least three values for gridding (X, Y, Z). The X, Y, and Z values are each placed in separate columns. The X and Y coordinates define the position of the point on the map, and the Z value defines the value assigned to the specific X, Y location. Common examples of X, Y coordinates include longitude and latitude, easting and northing, or UTM (Universal Transverse Mercator) coordinates. The Z data might be topographic elevation, water depth, chemical concentration, temperature, or any other quantity amenable to mapping.

Data files can be created in the Surfer worksheet, a text editor, or any program that can produce files in one of the supported file formats. Regardless of the program used to create your data files, you must save the file on disk prior to performing any Surfer operation requiring a data file, including the gridding operation. Surfer reads data only from a data file in one of the recognized formats.

It is not necessary to open a data file in the worksheet in order to use the data file for a command (e.g. Grid | Data). If you want to view or alter the data in a data file, you can use the File | Open in Worksheet command to gain access to the worksheet data.

Surfer requires the use of decimal degree values when using Latitude and Longitude data.

XYZ Data Files

XYZ data files contain the raw data Surfer interprets to produce a grid file. Before you create a grid file in Surfer, you must create an XYZ data file. XYZ data files must be organized in column and row format. By default, Surfer expects the X data to be contained in column A, the Y data in column B, and the Z data in column C. However, the data can be placed in any order in any column.

Portions of two simple data files are shown below. The order of the data in the file is not important. These examples contain descriptive headers in Row 1 of each column. Such information is helpful but not required by Surfer to create a grid file. When text appears in Row 1 of a column, this text appears in list boxes in various Surfer dialogs as column titles. If a number resides in Row 1, it is not incorporated into the dialogs, and instead, the column heading (such as column B) is displayed.

This is a simple XYZ data file.

This is another example of an XYZ data file with header information in row 1 of each column in the data file.

Missing Entries

Rows with non-numeric entries (empty cells or text) in any of the X, Y, or Z columns are excluded when performing various tasks, including gridding or transforming data in the worksheet. If there is no Z information for a particular XY location, you can leave the Z cell blank for that row. In the example shown here, there are two data records without Z values. These records are not considered during the gridding operation.

Blank Z column cells are ignored when gridding a data file.

Multiple Columns of Information for Additional Maps

Data files can contain up to one billion columns. Since you can specify the columns to be gridded, your X, Y, and Z values can occupy any three columns. This allows you to have columns containing other information particular to each point. The data file can contain several Z columns, so you can produce several contour maps using the same XY coordinates. For example, you might have concentrations of different contaminants at each sample location. All the contaminant concentration data can be placed in the same data file.

This is an example of an XYZ data file containing several columns of Z data. You could use this file to create several different grid files, where each uses the same XY coordinates, but different Z data.

Additional Information in Data Files

Data files may contain information in addition to the X, Y, and Z values. For example, when posting data with the Home | New Map | Post command, additional columns can be used to specify the symbol, the rotation angle, the symbol color, labels, etc. The following is an example of such a data file. Columns A, B, and C contain the X, Y, and Z data used to produce a contour map of depth to the water table. Columns D, E, and F contain information used to create an overlaying post map.

A data file used to create a post map or a classed post map can contain several columns of data. Each column can have a different effect on the posted data points.

Data as Numbers or Text

Worksheet data are in one of two forms: numbers or text. Grid file creation, statistics, post maps, and other operations require data as numbers. Text data (even if it contains numeric digits) can be used for labels in Surfer, but it cannot be used to create grids or in any operation requiring numbers.

Numbers can consist of digits (0 - 9), decimal points ( . ), the letters "e," "d," "E," or "D" (indicating an exponent), and the plus (+) or minus (-) sign. If you type any characters other than these when entering a number (or type any of the special characters more than once), Surfer automatically converts the cell entry to text. For example, if your longitude data appears as 104.5 W in a worksheet cell, it is interpreted as text and cannot be used to grid data. To successfully read this data, use the -104.5 format to indicate a location 104.5 degrees west of the prime meridian. If a number has if formatted as text and should be formatted as a number, highlight the cell or group of cells to select them and click the Text to Number command.

You can also convert numeric data to text by typing a single quotation mark ( ' ) in front of the number. Surfer does not place the single quotation in the worksheet cell, however the single quotation is visible in the Active Cell Edit Box.

By default, numeric data is right justified in a cell, and text is left justified. Cell entries, whether numeric or text, can be justified by specifying the desired alignment using the options on the Alignment page of the Format Cells dialog. Use the Text to Number command to remove text formatting.

example image

Notice that column B is left aligned. This means the numbers are formatted as text. When a cell is highlighted, an apostrophe appears in the active cell edit box, also indicating that the number is formatted as text.

See Also

Worksheet Document

Remove Text Formatting

File | Open in Worksheet and Open Data