GridData
The GridData method is superseded by GridData6. Please consider using the more recent version. GridData has been retained for backward compatibility.
GridData creates a grid from irregularly spaced XYZ data. Grid files are required to create different types of maps, including contour, image, shaded relief, vector, 3D surface, and 3D wireframe. The grid data files are typically randomly spaced files, and this data must be converted into an evenly spaced grid before using. GridData returns a Boolean value. It returns 'True' if the grid file is successfully created, otherwise returns 'False'.
The GridData2 command should specifically be used instead of GridData when the worksheet being loaded is an Excel file where the sheet name needs to be specified. It can also be used to specify any data import options when loading a data file.
Syntax
object.GridData( DataFile, xCol, yCol, zCol, ExclusionFilter, DupMethod, xDupTol, yDupTol, NumCols, NumRows, xMin, xMax, yMin, yMax, Algorithm, ShowReport, SearchEnable, SearchNumSectors, SearchRad1, SearchRad2, SearchAngle, SearchMinData, SearchDataPerSect, SearchMaxEmpty, FaultFileName, BreakFileName, AnisotropyRatio, AnisotropyAngle, IDPower, IDSmoothing, KrigType, KrigDriftType, KrigStdDevGrid, KrigVariogram, MCMaxResidual, MCMaxIterations, MCInternalTension, MCBoundaryTension, MCRelaxationFactor, ShepSmoothFactor, ShepQuadraticNeighbors, ShepWeightingNeighbors, ShepRange1, ShepRange2, RegrMaxXOrder, RegrMaxYOrder, RegrMaxTotalOrder, RBBasisType, RBRSquared, OutGrid, OutFmt, SearchMaxData, KrigStdDevFormat, DataMetric, LocalPolyOrder, LocalPolyPower, TriangleFileName )
Parameter |
Type |
Required/ Optional |
Default |
Description |
DataFile |
String |
Required |
|
This provides the path and file name of the XYZ data file name |
xCol |
Long |
Optional |
1 (Column A) |
This provides the column containing X values, column A = 1. |
yCol |
Long |
Optional |
2 (Column B) |
This provides the column containing Y values, column B = 2. |
zCol |
Long |
Optional |
3 (Column C) |
This provides the column containing Z values, column C = 3. |
ExclusionFilter |
Variant |
Optional |
|
This provides the Boolean search to exclude values. |
DupMethod |
Variant |
Optional |
|
This provides the method for eliminating duplicates, the SrfDupMethod enumeration can be used for this parameter. |
xDupTol |
Variant |
Optional |
|
This provides the separation distance of X values to be considered duplicates. |
yDupTol |
Variant |
Optional |
|
This provides the separation distance of Y values to be considered duplicates. |
NumCols |
Variant |
Optional |
|
This provides the grid line geometry number of columns. |
NumRows |
Variant |
Optional |
|
This provides the grid line geometry number of rows. |
xMin |
Variant |
Optional |
|
This provides the grid line geometry minimum X value. |
xMax |
Variant |
Optional |
|
This provides the grid line geometry maximum X value. |
yMin |
Variant |
Optional |
|
This provides the grid line geometry minimum Y value. |
yMax |
Variant |
Optional |
|
This provides the grid line geometry maximum Y value. |
Algorithm |
Variant |
Optional |
|
This provides the gridding method (kriging, etc.), the enumeration can be used for this parameter. |
ShowReport |
Variant |
Optional |
|
This enables the show grid report, the report is only shown if ShowReport is true and Surfer is visible. |
SearchEnable |
Variant |
Optional |
|
This enables No Search (use all of the data). It is one of the search options. |
SearchNumSectors |
Variant |
Optional |
|
This provides the number of sectors to search. |
SearchRad1 |
Variant |
Optional |
|
This provides the search ellipse radius 1. It is one of the search options. |
SearchRad2 |
Variant |
Optional |
|
This provides the search ellipse radius 2. It is one of the search options. |
SearchAngle |
Variant |
Optional |
|
This provides the search ellipse angle. It is one of the search options. |
SearchMinData |
Variant |
Optional |
|
This provides the minimum number of data in all sectors (node is blanked if the data surrounding the node are less than this number). |
SearchDataPerSect |
Variant |
Optional |
|
This provides the maximum number of data to use from each sector. |
SearchMaxEmpty |
Variant |
Optional |
|
This provides the number of blank nodes if more than this many sectors are empty. |
FaultFileName |
Variant |
Optional |
|
This provides the file containing fault traces. |
BreakFileName |
Variant |
Optional |
|
This provides the file containing breaklines. |
AnisotropyRatio |
Variant |
Optional |
|
This provides the anisotropy ratio used for various algorithms. |
AnisotropyAngle |
Variant |
Optional |
|
This provides the anisotropy angle used for various algorithms. |
IDPower |
Variant |
Optional |
|
This specifies the inverse distance to a power, power number. |
IDSmoothing |
Variant |
Optional |
|
This specifies the inverse distance to a power, smoothing factor. |
KrigType |
Variant |
Optional |
|
This specifies the kriging type (point or block. The enumeration can be used for this parameter. |
KrigDriftType |
Variant |
Optional |
|
This specifies the kriging drift type (none, linear, or quadratic), the enumeration can be used for this parameter. |
KrigStdDevGrid |
Variant |
Optional |
|
This provides the output grid of kriging standard deviations |
KrigVariogram |
Variant |
Optional |
|
This specifies the kriging variogram model. KrigVariogram may contain an array of VarioComponent objects. If this parameter is not specified the default Linear variogram is used. |
MCMaxResidual |
Variant |
Optional |
|
This specifies the minimum curvature maximum residual. |
MCMaxIterations |
Variant |
Optional |
|
This specifies the minimum curvature maximum number of iterations. |
MCInternalTension |
Variant |
Optional |
|
This specifies the minimum curvature internal tension factor. |
MCBoundaryTension |
Variant |
Optional |
|
This specifies the minimum curvature boundary tension factor. |
MCRelaxationFactor |
Variant |
Optional |
|
This specifies the minimum curvature relaxation factor. |
ShepSmoothFactor |
Variant |
Optional |
|
This specifies the modified Shepard's method smoothing factor. |
ShepQuadraticNeighbors |
Variant |
Optional |
|
This specifies the modified Shepard's method quadratic neighbors. |
ShepWeightingNeighbors |
Variant |
Optional |
|
This specifies the modified Shepard's method weighting neighbors. |
ShepRange1 |
Variant |
Optional |
|
This specifies the modified Shepard's method anisotropy range 1. |
ShepRange2 |
Variant |
Optional |
|
This specifies the modified Shepard's method anisotropy range 2. |
RegrMaxXOrder |
Variant |
Optional |
|
This specifies the polynomial regression maximum X order. |
RegrMaxYOrder |
Variant |
Optional |
|
This specifies the polynomial regression maximum Y order. |
RegrMaxTotalOrder |
Variant |
Optional |
|
This specifies the polynomial regression maximum total order. |
RBBasisType |
Variant |
Optional |
|
This specifies the radial basis function type (inverse multiquadric, multilog, multiquadric, natural cubic spline, or thin plate spline), theSrfBasisTypeenumeration can be used for this parameter. |
RBRSquared |
Variant |
Optional |
|
This specifies the radial basis function correlation coefficient |
OutGrid |
String |
Optional |
"" |
This provides the path and file name of the output grid file. |
OutFmt |
Optional |
srfGridFmtS7 |
This provides the output grid file format, |
|
SearchMaxData |
Variant |
Optional |
|
This specifies the maximum number of data to use from all sectors. This one of the search criteria. |
KrigStdDevFormat |
Variant |
Optional |
|
This specifies the standard deviation grid file format, theenumeration can be used for this parameter |
DataMetric |
Variant |
Optional |
|
This specifies one of thedata metricoptions, the SrfDataMetric enumeration can be used for this parameter. |
LocalPolyOrder |
Variant |
Optional |
|
This specifies the local polynomial order. |
LocalPolyPower |
Variant |
Optional |
|
This specifies the local polynomial power (0 to 20). |
TriangleFileName |
Variant |
Optional |
|
This provides the name of the file to contain the triangulation - the format is determined by the file name extension. |
Remarks
Please refer to the gridding advanced options dialogs for more information on using gridding options. Some of the above options require certain parameters to be used and some parameters cannot be used with other parameters. For example, SearchEnable must be enabled to successfully use the seven parameters (Search...) that follow it. Another example is if the natural neighbor gridding method is selected for Algorithm, KrigVariogram should not be set. Since this method contains so many parameters, try using named arguments for this method (see examples below). There is no need to preload the file into the worksheet.
Example 1
This example uses the Kriging method for gridding data.
SurferApp.GridData(DataFile:=SurferApp.Path+"\Samples\demogrid.dat", xCol:=1, yCol:=2, _
zCol:=3, Algorithm:=srfKriging, ShowReport:=True, SearchEnable:=True, _
KrigStdDevGrid:=SurferApp.Path+"\Samples\StdDev.grd, _
OutGrid:=SurferApp.Path+"\Samples\sample1a.grd", OutFmt:=srfGridFmtS7)
Example 2
This script displays all the methods in the Application object.
Used by: Application object