Surfer 8: Creating a Variogram Map and Surface

28/01/2004

Here is a quick recipe to creating a Variogram Map and Surface in Surfer. To try this out for yourself download the demo version of Surfer.

The Variogram Plot and Grid

A variogram displays half the average difference in Z values of two data points as a function of the separation distance between the points. The black curve displays the actual data, and the blue curve displays a function that models the data. The kriging gridding method uses the variogram model to calculate Z values throughout the map area.

The variogram displays half the average difference between two points as a function of their separation distance.

Surfer uses a polar grid to store a summary of variogram information for all the data pairs that fall into each grid cell (defined by the lag distance and angle). When the Lag Tolerance is set to less than 90°, the variogram curve shows the values for a particular direction through the variogram grid. The variogram grid is not directly accessible, but you can export it one line at a time. The angle of the Lag Direction and magnitude of the lag can be used to calculate the XY coordinates, with the variogram value as the Z value. Grid the resulting XYZ file to display an image map or 3D Surface of the variogram data. The process can be automated with a script.
The Surfer variogram grid stores information about the variance between data point pairs based on the distance and angle between points.

Step-by-step Procedure

  1. Choose the Grid | Variogram | New Variogram menu command.

  2. Specify the data file, and click Open. Click OK in the New Variogram dialog box to accept the default parameters.

  3. Double-click on the variogram plot to display the Variogram Properties dialog box. On the Experimental tab, change the Lag Direction Tolerance to 30 and click Apply.

  4. Choose the Grid | Variogram | Export Variogram menu command, enter a file name, such as variogram000.dat, and click the Save button.

  5. Open variogram000.dat in the worksheet. Insert a blank row at row 1 and label the columns as follows: column A = Lag, column B = Variogram, column C = # pairs, column D = X, column E = Y.

  6. To calculate the X and Y values, select column A to set the number of rows, choose the Data | Transform menu command, and enter the formula:

    D = A * cos ( d2r ( 0 ) )

    where:

    D = the destination column for the X values.
    A = the lag or separation distance.
    cos() = the cosine function.
    d2r() = the degree to radian function.
    0 = the lag angle for this variogram.

    Repeat with the sin function to calculate the Y values in column E:

    E = A * sin ( d2r ( 0 ) )

    For the lag angle of 0, X = lag and Y = 0.

    Save the changes to the new file VarioCombined.dat to preserve the original Variogram000.dat file as a backup.

  7. Choose the Window | Plot 1 menu command to return to the variogram window. Change the Lag Direction to 5 degrees and click Apply.

  8. Chose the Grid | Variogram | Export Variogram menu command and name the file Variogram005.dat.

  9. Choose the Window | Variogram000.dat menu command to switch to the worksheet window. Press the End key to go to the last row in the worksheet. Click the blank cell in column A below the last row. Choose the File | Import menu command and specify the Variogram005.dat file.

  10. Select the new rows added to the worksheet. Calculate the X and Y values as in Step 6 above, changing the angle from 0 to 5:

    D = A * cos ( d2r ( 5 ) )
    E = A * sin ( d2r ( 5 ) )

  11. Save the changes to VarioCombined.dat.

  12. Repeat Steps 7 - 11 in 5 degree increments through 175 degrees.

  13. Paste a copy of the data to the end of the file. Multiply the pasted X and Y values by -1 with the Data | Transform menu command. Save the changes. This step adds the data from 180 through 360 degrees.

  14. Grid the data and create an image map, surface map, or contour map.

Automating the Process with a Script

Exporting the variogram curves can be automated with a script. Refer to VarioExport.bas