The KRIGRID Control File

The KRIGRID control file is used to set the parameters that control the gridding process. It is a five-line text file that can be created and modified with any text file editor.

The file is free-format, which means that the positioning of data within a line is not important. Each line must end with a slash character (/), after which any user comments may be entered on the same line. Most parameters will assume a default value if not specified. If more than one value is to be placed on any line the values must be separated by a blank or comma. For example, if a line of the control file accepts three parameters, the first and third parameters can be set using the following format:

  • To see how to setup this file, we recommend that you use a text editor to display the KRIGRID control file (krigrid.con) that is shipped with the product.
  • Following is a summary of the parameters:

    line 1: cs

    line 2: xmin,ymin,xmax,ymax

    line 3: iz,zb,zm,logopt,logmin,clip

    line 4: desamp,blank,search,minrad,maxrad,minpts,maxpts

    line 5: model,nugget,range,sill,n,hmax,dh,trend 

    The file is free-format, which means that the positioning of data within a line is not important. Each line must end with a slash character (/), after which any user comments may be entered on the same line. Most parameters will assume a default value if not specified. If more than one value is to be placed on any line the values must be separated by a blank or comma. For example, if a line of the control file accepts three parameters, the first and third parameters can be set using the following format:

    1st#,,3rd# /

    If all parameters of a line are to have their default values, just enter a slash (/) to indicate the end of the line. Remember that each line of the control file must end with a slash character. A self-documented blank control file named KRIGRID.CON is supplied with KRIGRID. This file can be copied from the \GEOSOFT directory into the local working directory and edited to set parameters as desired.

    The following sections describe the parameters on each control file line.

    Line 1: cs

    The required grid cell size in the distance units of the XYZ file.

    The grid cell size is in the distance units of the data. We recommend a cell size of ¼ to ½ the nominal data sample interval. The default is one quarter the average data separation based on a statistical average. A smaller cell size may be required if the data is to be contoured (we recommend 2 mm. or 1/10 inch at plot scale for contouring). This can be achieved by specifying a smaller cell size and larger desampling factor (desamp), or by regridding the grid using BIGRID.

    Line 2: xmin,ymin,xmax,ymax

    The limits of the area to be gridded.

    Xmin, Ymin

    The ground coordinates of the first grid point at the bottom left corner of the rectangular grid area. (Default, the minimum limits of the input data file are used).

    Xmax, Ymax

     The ground coordinates of the last grid point at the top right corner of the rectangular grid area. (Default, the maximum limits of the input data file are used).

    Line 3: iz,zb,zm,logopt,logmin,clip

    Data selection and output grid values

    iz  the z value selection. For the case of XYZ files with more than one z value, iz selects which z value is to be gridded. By default the first z value is gridded (iz=1). Note that this is column 3 of the XYZ file since the first two columns X and Y are position coordinates.

      Values are stored in grid files as 2-byte integers. This means that the data resolution and range in a grid file is limited to whole numbers in the range from -32766 to 32767 (-32767 is reserved for the grid dummy value). In order to take maximum advantage of this range, a base level is removed from the values and a multiplier is applied to expand or compress the data to optimally fit the range.

    output grid value = (Z value - zb) * zm

    zb  base level removed from the gridded data before conversion to the output grid value in integers. By default, an appropriate value is determined from the data.

    zm  a multiplication factor that is applied to the gridded data after removal of the base level (zb) in order to convert the data to output grid values in integer format. By default an appropriate value is determined.

  • The multiplier determines the precision of the data in the grid. If the data is to be contoured, the multiplier should be at least 10 times the lowest contour interval. The minimum contour interval must always be a multiple of the grid multiplier. 
  • The logarithm (base 10) of the data can be gridded rather that the original data. Once gridded, KRIGRID can store either the logarithmic data in the output grid, or rescale the data to the original units before storing in the final grid. Gridding the log of the data can be a very effective way to reduce distortion due to highly skewed data such as geochemical data.

    logopt

     0 grid the data as is (the default)

     1 grid log(Z), where any Z-value less than logmin is replaced by logmin.

     2 grid log(Z) outside the range ±logmin, and use the original Z in the range ±1.

    With logopt of +1 or +2, the output grid will be logarithmic (an original value of 100 will be 2 in the grid). Grids produced with logopt = 1 can be contoured and labelled correctly by setting logopt in CONTOUR to 1.

    Options -1 and -2 will cause KRIGRID to place 10 to the power of the gridded Z values in the output grid. This can be an effective way to reduce the effect of extreme values in highly skewed data.

    logmin  the minimum allowed Z value for logopt=1, or the amplitude around zero for linear gridding with logopt=2. This must be a positive non-zero number. The default is 1.0.

    clip  When you have data with a very high dynamic range, there may be instances when certain grid values exceed the allowable range, even with scaling. This parameter allows you to control how this is handled.

     0 blank out (dummy) the values exceeding the range

     1 clip these values at the maximum or minimum (default)

    Line 4: desamp,blank,search,minrad,maxrad,minpts,maxpts

    desamp  The de-sampling factor is defined as a function of the grid cell size. Before any further calculations, all points within cells of dimension cell_size x desampling_factor are averaged into a single value and placed in the center of the cell.The default desampling (desampling_factor) is set relative to the contributing points as:Desampling has two impacts:Effectively it acts as a low-pass filter. The larger this parameter the smoother the output grid.Speeds up the variogram calculation when the input database is very large.If the database contains less than 100000 contributing points, the default is set to 1, and the only pre-filtering consists of de-aliasing at the cell level.The variogram calculation duration is a function of the square of the contributing points. Increasing this factor visibly cuts down the variogram calculation time while little impact is seen on the variogram curve.

    blank  All grid cells farther than the blanking distance from a valid point will be set to dummies in the output grid.
    The default blanking distance is calculated as:
    Preferably this parameter should be set to just greater than the maximum distance through which interpolation is desired.

    The remaining parameters control how KRIGRID collects data points to be used in the matrix inversion of each grid node. Ideally, KRIGRID should use all data points. However, if there are more than 120 points, there is insufficient memory available to store the matrix in the computer, and the inversion time can be quite slow. Furthermore, only the data points within the region of a grid node will have a significant effect on the kriged value at that node. For data sets larger than 120 points, KRIGRID searches for a minimum number of data points (default 8) within a minimum and maximum search radius of each grid node. The search can be based on closest distance to the node (search option 1), or on closest distance within each octant surrounding the node (search option 2).

    search  Search option:

     1 Universal search - use nearest points disregarding direction. This is the default if the data contains more than 120 points. This option is fine for evenly sampled data. If your data is clustered (large distances between groups of points), use option 2.

     2 Octant Search - use nearest points in each octant surrounding the grid point to be calculated. Searching continues until each octant has between minpts/8 and maxpts/8 points, or until maxrad is reached. This is the best option for clustered data because it evenly distributes the data based on direction.

      The octant search option can produce undesirable star patterns in the grid. These are the result of a grid cell that is too small relative to the data distribution, or too few points used for each calculation. If you get star patterns, you should increase the grid cell size or increase minpts and maxpts.

     3 Use all data points without searching. This option can only be used for 120 or fewer data points. The following parameters on this line are ignored for this option. This will produce the best results and is the default if the data contains fewer than 120 data points.

    minrad  The minimum search radius. The default is 8 times the grid size. If data found is less than minpts within this minrad, the search radius will be doubled and the data searched again until either minrad are found, or maxrad is reached. This only applies for Universal and Octant searches.

    maxrad  The maximum search radius. The default is 32 times the grid size. If less than minpts data points are found within maxrad radius, a dummy value is assigned to the grid point. This parameter only applies for Universal and Octant searches.

    minpts  The minimum number of points required before a grid value will be calculated. The default is 8. This only applies for Universal and Octant searches. Increasing this number consumes more time, but will produce a more continuous looking grid.

    maxpts  The maximum number of points that can be used to calculate a grid value. The default is 16. Only the nearest maxpts points will be used regardless of the search radius. This only applies for Universal and Octant searches. Increase this value and minpts if the grid contains discontinuities between data points in regions of sparse sampling.

    Line 5: model,nugget,range,sill,n,hmax,dh,trend

    model  The variogram model to be used:

     0 User defined (requires input variogram)

     1 Power model using power n (n=0 for linear)

     2 Spherical model (requires nugget, range and sill)

     3 Gaussian model (requires nugget, range and sill)

     4 Exponential model (requires nugget, range and sill)

    nugget  The nugget for all models. The nugget is the average error in each data point, and is indicated by the intersection of the variogram model with the h=0 axis. The default is 0.

    range  Range/Slope. For spherical, Gaussian and exponential models, the range is the distance at which the variogram model reaches the sill value. Beyond the range, the data is uncorrelated. The range must be entered for the spherical, Gaussian and exponential models. For the power model, this is the rate of climb, or slope for a linear model.

    sill  Sill. This is the level at which the variogram becomes uncorrelated, or goes flat. Beyond the (range, sill) point, the variogram is flat. The sill must be specified for the spherical, power and Gaussian models.

    n  This is the power for the power model. The default is 1. In this case, the nugget and slope are fit to the data by default if not specified.

    hmax  The maximum distance at which to calculate the observed variogram.

    dh  The increment of h at which to calculate variogram values.

    trend

     0  for ordinary kriging (no trend, default),

     1 for universal kriging (the data has a background trend).

    KRIGRID Gridding Log Report

    KRIGRID produces a report of progress during the gridding process. The report gives details about the input data and lists the KRIGRID parameters that were either given in the KRIGRID control file or were determined by default; then lists the calculated and model variogram and performs the kriging and reports each grid row as it is completed; and finally writes out the output grid and reports the grid parameters.