Grid files are necessary in Surfer to create grid-based maps types. Data files are typically randomly spaced files, and this data must be converted into an evenly spaced grid before using many of Surfer's features. Grid files are produced from XYZ data using the Home | Grid Data | Grid Data or the Grids | New Grid | Grid Data command. With this command, you can specify the parameters for the particular gridding method and the extents of the grid. The gridding methods define the way in which the XYZ data are interpolated when producing a grid file. Refer to the tutorial for more information on data and gridding data.
When creating a grid file you can usually accept all the default gridding parameters and generate a grid file that represents your data well. Under most circumstances, the recommended gridding method is kriging with the default linear variogram. This is the selected default gridding method because it gives good results for most XYZ data sets.
There are several gridding parameters you can set when producing a grid file. Refer to the gridding method for more information on specific parameters. Most gridding methods require at least three non-collinear data points. The Inverse Distance, Nearest Neighbor, Moving Average, and Data Metrics methods require at least three data points, collinear or not. Some methods require more data points. For example, a higher-order polynomial fit needs more than three data points; there must be at least as many data as there are degrees of freedom. When the Z Transform is set to Log, save as log or Log, save as linear, at least three data points must contain Z values that are non-negative and non-zero. Click the Grids | New Grid | Grid Data or Home | Grid Data | Grid Data command to choose the data to be used in the gridding process.
Click the Grids | New Grid | Grid Data or Home | Grid Data | Grid Data command to display the Open Data dialog. Select a data file and click Open. The Grid Data dialog is displayed.
Gridding options are set in the Grid Data dialog.
Individually specify the columns for the X data, the Y data, and the Z data in the Data Columns section. Surfer defaults to X: Column A, Y: Column B, and Z: Column C. However, your data can be in any three columns. Click the down arrow on each box and select the appropriate column for each variable. If the data file was selected from the Open worksheets list in the Open Data dialog, assigned XYZ columns (if any) will populate the appropriate columns in the Data Columns group. Columns containing dates or numbers can be selected.
Note: When using date/time formats for any of the Data Columns, the values are stored in the grid as numbers, not in date/time format. To display date/time formats on the map, select the appropriate map part (axis, map layer, or map) and set the date/time label format.
You can filter the data before gridding based on a predefined filter or based on a user-defined equation by clicking the Filter Data button.
If you are unsure of which columns contain your XYZ data, click the View Data button to see the data file in a worksheet format. If you get an Insufficient data (3 or more XYZ triplets required) error, use View Data to check the layout of the data. One common reason for this warning is that the data is not numeric or date/time format. After clicking View Data, make sure that all three columns of data are right aligned. If one of the columns is left aligned, the data are text, not numbers. You can use the data view to determine the appropriate columns for the X, Y, and Z values.
Click the Statistics button to display statistics based on the selected X, Y, and Z columns.
Check the box next to the Grid Report option to create a gridding report that includes all the gridding parameters used to generate a grid. This report also includes statistics about the grid. You can also access the grid statistics by creating a grid information report. Create a grid information report in the Grid Editor by clicking the Grid Editor | Options | Grid Info command or by clicking the Grids | Info | Grid Info command from any document window.
Surfer has several different gridding methods. These gridding methods define the way in which the XYZ data are interpolated when producing a grid file. Choose the Gridding Method and gridding options (Advanced Options button) in the Gridding Method group. Refer to the gridding methods help topics for more information on the options.
Click the Cross Validate button to perform cross validation on your data. Cross validation is an objective way of assessing the gridding parameters for your data set. Cross validation is always performed on the linear Z values, not the transformed Z values.
The Output Grid Geometry section defines the grid limits and grid density.
The Copy geometry from option copies the grid geometry from an existing map layer or grid file. This option is useful when creating grids that will become overlaid map layers, processed with the Grid Math command, or used to calculate a volume between two surfaces. The Math and Volume commands require the input grids to have the same geometry.
To copy the geometry from an existing layer, select the layer in the Copy geometry from list. To copy the geometry from a grid file, click Browse and select the file in the Open Grid dialog. .
The Copy geometry from option displays <Custom> when the Minimum, Maximum, Spacing, or # of Nodes values have been manually edited. Select <None> to return the Output Grid Geometry options to their default values. Select a layer or file to copy the grid geometry.
Grid limits are the minimum and maximum X and Y coordinates for the grid. Surfer computes the minimum and maximum X and Y values from the XYZ data file. These values are used as the default minimum and maximum coordinates for the grid.
Grid limits define the X and Y extent of the output grid. The extents of the grid define the extents of contour maps, color relief maps, 3D surfaces, and other maps created from grid files. When creating a grid file, you can set the grid limits to the X and Y extents you want to use for your map. Once a grid file is created, you cannot produce a grid-based map larger than the extent of the grid file. If you find you need larger grid limits, you must regrid the data. You can, however, read in a subset of the grid file to produce a map smaller than the extent of the grid file.
When either the X, Y, or Z value is in a date/time format, the date/time values are converted and stored in the grid as numbers.
Grid density is usually defined by the number of columns and rows in the grid, and is a measure of the number of grid nodes in the grid. The # of Nodes in the X Direction is the number of grid columns, and the # of Nodes in the Y Direction is the number of grid rows. The direction (X Direction or Y Direction) that covers the greater extent (the greater number of data units) is assigned 100 grid nodes by default. The number of grid nodes in the other direction is computed so that the grid nodes Spacing in the two directions are as close to one another as possible.
By defining the grid limits and the number of rows and columns, the Spacing values are automatically determined as the distance in data units between adjacent rows and adjacent columns.
Higher grid densities (smaller Spacing and a larger # of Nodes) increase the smoothness in grid-based maps. However, an increase in the number of grid nodes proportionally increases the gridding time, drawing time, and the grid file size. You can have up to 2,147,483,647 rows and columns in a grid file. It is likely your computer will run out of memory before reaching the maximum grid size. The primary use for the large grid size maximum is to allow grids with extreme aspect ratios to be created.
The larger the density of grid nodes in the grid, the smoother the map that is created from the grid. Contour lines and XY lines defining a wireframe are a series of straight-line segments. More X and Y grid nodes in a grid file result in shorter line segments for contours or wireframe maps. This provides a smoother appearance to contour lines on a contour map or smoother appearing wireframe.
Although highly dense grid files can be created, time and space are practical limits to the number of grid nodes you may want to create in a grid file. The grid density limit is based on the amount of available memory in your computer and the size of the data file used to create the grid. Limited memory, very large data files, very dense grids, or any combination of these factors can greatly increase gridding time. When gridding begins, the status bar provides you with information about the estimated gridding time to complete the task. If gridding time is excessive, click in the plot window to cancel the gridding operation.
Some examples of the amount of memory needed to grid large files:
A 10,000 x 10,000 grid requires 10000*10000*8 = 763MB.
A 15,000 x 15,000 grid requires 1.7GB.
A 20,000 x 20,000 grid requires 3GB which is more than a 32-bit OS can address (although it is possible on an 64 bit OS)
A 2,147,483,647 x 2 grid requires 32GB of contiguous RAM (most computers contain a maximum of 16GB RAM stored noncontiguously)
You can also increase or decrease the grid density by using the Grid | Spline Smooth, Grid | Extract, or Grids | Resize | Mosaic commands.
Consider these examples. The data range from 0 to 25 in the Y dimension and 0 to 10 in the X dimension. The two examples use different numbers of grid nodes, or grid spacing, during gridding.
Two different Grid Line Geometry examples are shown here. These are based on the same data file. The coordinates range from zero to 10 in the X direction and zero to 25 in the Y dimension.
In the example on the left above, the grid Spacing is set approximately equal in the X and Y dimensions (one unit each). This results in a different number of grid nodes in the X and Y dimensions. In the example on the right above, the same # of Nodes are specified in the two dimensions. This results in an unequal spacing in data units in the two dimensions.
The Output Grid Geometry information specified in the Grid Data dialog for each of the examples is displayed below.
This shows the Output Grid Geometry information for the 11 by 26 grid. The grid node spacing values are set to one, resulting in a different number of grid nodes in the X and Y dimensions.
This shows the Output Grid Geometry information for the 5 by 5 grid. The number of nodes is equal, resulting in different spacing in the X and Y dimensions.
In some cases, the gridding interpolation and extrapolation can result in undesired values, for example negative numbers in cases where negative values are physically impossible. The Grid Z Limits options clamp the grid output to specific minimum and maximum values.
The Grid Z Limits are applied after the interpolation operation. After the grid interpolation is performed, Surfer locates any grid values less than the Minimum and replaces them with the Data min or Custom value. Surfer locates any grid values greater than the Maximum and replaces them with the Data max or Custom value.
To clamp the output to a specific minimum value, click the current selection next to Minimum, and select None, Data min, or Custom from the list. If Data min is selected, the data minimum will be displayed in the field to the right of the Minimum list. Select Custom and type a value in the input box to use a user-defined Minimum.
To clamp the output to a specific maximum value, click the current selection next to Maximum, and select None, Data max, or Custom from the list. If Data max is selected, the data maximum will be displayed in the field to the right of the Maximum list. Select Custom and type a value in the input box to use a user-defined Maximum.
The convex hull of a data set is the smallest convex polygon containing all the data. The convex hull can be thought of as a rubber band that encompasses all data points. The rubber band only touches the outside points. So, areas inside the convex hull without data are still gridded.
Check the box next to the Assign NoData outside convex hull of data to automatically assign the NoData value to the grid nodes outside the convex hull of the data. Leave the box cleared to extrapolate the data to the minimum and maximum grid limits, regardless of whether data exists in these areas.
The Inflate convex hull by option expands or contracts the convex hull. When set to zero, the boundary connects the outside data points exactly. When set to a positive value, the area assigned the NoData value is moved outside the convex hull boundary by the number of map units specified. When set to a negative value, the area assigned the NoData value is moved inside the convex hull boundary by the number of map units specified.
To change the value, highlight the existing value and type the desired value. Values are in horizontal (X) map units. If the value is set to a large positive value, the grid values may extend all the way to the minimum and maximum X and Y limits of the grid, essentially overriding the Assign NoData outside convex hull of data option. If the value is set to a large negative value, the entire grid may be assigned the NoData value, resulting in no grid file being created.
This example, with a data set such as the points on the left below, checking the Assign NoData outside convex hull of data option will leave the outer edges of the map blank due to the NoData values in these areas. The three contour maps display the resulting grid file when the Inflate convex hull by option is set to 0, inflated by 1.5, and deflated by -1.5. Contours always extend to the same minimum and maximum X and Y coordinates. Contour lines align in all three situations. The only difference is how far the contours extend from the convex hull.
This data has an area near the top left corner with no data. When the Assign NoData outside convex hull of data option is selected, no contours appear in this area. Setting the Inflate convex hull by value to a positive value (3rd image) creates a buffer around the outside of the data points. Setting the Inflate convex hull by value to a negative value (last image) brings the contours inside the convex hull of data.
The Z Transform option changes how the Z values are gridded. Available options are Linear; Log, save as log; and Log, save as linear. To change the Z Transform option, click on the existing option and select the desired option from the list.
Linear uses the Z values in the worksheet for gridding. No transformation is applied to the Z values. The Linear method is a good option for data that gradually increases over space. This is the default Z Transform.
Both Log options use take the log (base 10) of the Z values before gridding. The log (base 10) of the Z value is then used for gridding. The Log, save as log takes the log (base 10) of the Z values and uses the log value for gridding. The grid is then saved with the log (base 10) values. The Log, save as linear option takes the log (base 10) of the Z values and uses the log value for gridding. The grid is then converted back to the linear Z values by taking the antilog of the gridded results. When the Log, save as log or Log, save as linear option is selected, at least three data points must be positive Z values. Negative values are ignored for gridding. Both Log methods are good options when the data changes very quickly over a small area or when very high and very low values occur very closely to each other. This can be common with concentration values in ground water or geochemical data.
The images above display the difference in gridding the posted data with linear (top right) and log (bottom contours). The log contours on bottom show the difference in Z values between the grid when Log, save as log (bottom left) and Log, save as linear (bottom right) are selected.
Choose a path and file name for the grid file in the Output Grid group. You can type a path and file name, or click the button to browse to a new path and enter a file name in the Save Grid As dialog.
Create an XYZ data file. The data must be organized in columns: all X data in one column, all Y data in another column, and all Z data in a third column.
Click the Grids | New Grid | Grid Data command to display the Open Data dialog.
Specify the name of the XYZ data file, and click Open. To link to a database instead of a data file, click the Database button.
In the Grid Data dialog, specify the parameters for the type of grid file you want to produce.
Click OK and the grid file is created. During gridding, the status bar at the bottom of the Surfer window provides you with information about the progress of the gridding process.
A Gridding Example
Choosing a Gridding Method Based on the Number of XYZ Data Points
General Gridding Recommendations