GridDataXYZC
GridDataXYZC creates a grid from irregularly spaced XYZC data. Grid files are required to create different types of maps, including contour and color relief maps. XYZC grids are required to create volume render, isosurface, and slice modules in the 3D view. The input data files are typically randomly spaced files, and this data must be converted into an evenly spaced grid before using. GridDataXYZC returns a Boolean value. It returns 'True' if the grid file is successfully created, otherwise returns 'False'.
Syntax
object.GridDataXYZC( DataFile, xCol, yCol, zCol, cCol, ExclusionFilter, DupMethod, xDupTol, yDupTol, zDupTol, NumX, NumY, NumZ, xMin, xMax, yMin, yMax, zMin, zMax, Algorithm, ShowReport, SearchEnable, SearchEllipsoidType, SearchIsotropicRadius, SearchAnisotropicXLength, SearchAnisotropicYLength, SearchAnisotropicZLength, SearchGeneralFirstAxisX, SearchGeneralFirstAxisY, SearchGeneralFirstAxisZ, SearchGeneralSecondAxisX, SearchGeneralSecondAxisY, SearchGeneralSecondAxisZ, SearchGeneralThirdAxisX, SearchGeneralThirdAxisY, SearchGeneralThirdAxisZ, SearchMinData, SearchMaxData, AnisotropyEllipsoidType, AnisoAnisotropicXLength, AnisoAnisotropicYLength, AnisoAnisotropicZLength, AnisoGeneralFirstAxisX, AnisoGeneralFirstAxisY, AnisoGeneralFirstAxisZ, AnisoGeneralSecondAxisX, AnisoGeneralSecondAxisY, AnisoGeneralSecondAxisZ, AnisoGeneralThirdAxisX, AnisoGeneralThirdAxisY, AnisoGeneralThirdAxisZ, IDPower, IDSmoothing, DataMetric, LocalPolyOrder, LocalPolyPower, xSize, ySize, zSize, CLimitMinMethod, CLimitMaxMethod, CLimitMin, CLimitMax, CTransformMethod, SaveReportAs, ReportFormat, SaveSettingsAs, LoadSettingsAs, OutGrid, OutFmt, OutGridOptions )
Parameter |
Type |
Required/ Optional |
Default |
Description |
DataFile |
String |
Required |
|
This provides the path and file name of the XYZ data file name |
DataFileOptions |
Variant |
Optional |
|
This specifies data import options |
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. |
cCol |
Long |
Optional |
4 (Column D) |
This provides the column containing C values, column D = 4. |
ExclusionFilter |
Variant |
Optional |
|
This provides the Boolean search to exclude values. |
DupMethod |
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. |
zDupTol |
Variant |
Optional |
|
This provides the separation distance of Z values to be considered duplicates. |
NumX |
Variant |
Optional |
|
This provides the output grid geometry number of nodes in the X direction. |
NumY |
Variant |
Optional |
|
This provides the output grid geometry number of nodes in the Y direction. |
NumZ |
Variant |
Optional |
|
This provides the output grid geometry number of nodes in the Z direction. |
xMin |
Variant |
Optional |
|
This provides the output grid geometry minimum X value. |
xMax |
Variant |
Optional |
|
This provides the output grid geometry maximum X value. |
yMin |
Variant |
Optional |
|
This provides the output grid geometry minimum Y value. |
yMax |
Variant |
Optional |
|
This provides the output grid geometry maximum Y value. |
zMin |
Variant |
Optional |
|
This provides the output grid geometry minimum Z value. |
zMax |
Variant |
Optional |
|
This provides the output grid geometry maximum Z value. |
Algorithm |
Optional |
|
This provides the gridding method , the SrfGridAlgorithm enumeration can be used for this parameter. Only Inverse Distance to a Power, Local Polynomial or Data Metrics methods can be used. |
|
ShowReport |
Variant |
Optional |
|
'True' or '1' enables the show grid report, the report is only shown if ShowReport is true and Surfer is visible. 'False' or '0' does not show the report. |
SearchEnable |
Variant |
Optional |
|
'True' or '1' enables the search. 'False' or '0' disables the search, i.e. uses No Search (use all of the data). It is one of the search options. |
Search EllipsoidType |
Optional |
Isotropic |
This provides the search ellipsoid type to use. The srfEllipsoidType enumeration can be used for this parameter. Options are Isotropic, Anisotropic, and General. |
|
SearchIsotropicRadius |
Variant |
Optional |
|
Radius of the search sphere, when the search type is Isotropic. |
SearchAnisotropicXLength |
Variant |
Optional |
1/2 the X range |
Scale length along the X-axis, when the search type is Anisotropic. |
SearchAnisotropicYLength |
Variant |
Optional |
1/2 the Y range |
Scale length along the Y-axis, when the search type is Anisotropic. |
SearchAnisotropicZLength |
Variant |
Optional |
1/2 the Z range |
Scale length along the Z-axis, when the search type is Anisotropic. |
SearchGeneralFirstAxisX |
Variant |
Optional |
1/2 the X range |
X coordinate of the first semi-axis, when the search type is General. |
SearchGeneralFirstAxisY |
Variant |
Optional |
0 |
Y coordinate of the first semi-axis, when the search type is General. |
SearchGeneralFirstAxisZ |
Variant |
Optional |
0 |
Z coordinate of the first semi-axis, when the search type is General. |
SearchGeneralSecondAxisX |
Variant |
Optional |
0 |
X coordinate of the second semi-axis, when the search type is General. |
SearchGeneralSecondAxisY |
Variant |
Optional |
1/2 the Y range |
Y coordinate of the second semi-axis, when the search type is General. |
SearchGeneralSecondAxisZ |
Variant |
Optional |
0 |
Z coordinate of the second semi-axis, when the search type is General. |
SearchGeneralThirdAxisX |
Variant |
Optional |
0 |
X coordinate of the third semi-axis, when the search type is General. |
SearchGeneralThirdAxisY |
Variant |
Optional |
0 |
Y coordinate of the third semi-axis, when the search type is General. |
SearchGeneralThirdAxisZ |
Variant |
Optional |
1/2 the Z range |
Z coordinate of the third semi-axis, when the search type is General. |
SearchMinData |
Variant |
Optional |
|
This provides the minimum number of data in all sectors (node is assigned NoData if the data surrounding the node are less than this number). |
SearchMaxData |
Variant |
Optional |
|
This specifies the maximum number of data to use from all sectors. This one of the search criteria. |
AnisotropyEllipsoidType |
Optional |
Isotropic |
The anisotropy type to use. The srfEllipsoidType enumeration can be used for this parameter. Options are Isotropic, Anisotropic, and General. |
|
AnisoAnisotropicXLength |
Variant |
Optional |
1/2 the X range |
Scale length along the X-axis, when the anistropy type is Anisotropic. |
AnisoAnisotropicYLength |
Variant |
Optional |
1/2 the Y range |
Scale length along the Y-axis, when the anisotropy type is Anisotropic. |
AnisoAnisotropicZLength |
Variant |
Optional |
1/2 the Z range |
Scale length along the Z-axis, when the anisotropy type is Anisotropic. |
AnisoGeneralFirstAxisX |
Variant |
Optional |
1/2 the X range |
X coordinate of the first semi-axis, when the anisotropy type is General. |
AnisoGeneralFirstAxisY |
Variant |
Optional |
|
Y coordinate of the first semi-axis, when the anisotropy type is General. |
AnisoGeneralFirstAxisZ |
Variant |
Optional |
|
Z coordinate of the first semi-axis, when the anisotropy type is General. |
AnisoGeneralSecondAxisX |
Variant |
Optional |
|
X coordinate of the second semi-axis, when the anisotropy type is General. |
AnisoGeneralSecondAxisY |
Variant |
Optional |
1/2 the Y range |
Y coordinate of the second semi-axis, when the anisotropy type is General. |
AnisoGeneralSecondAxisZ |
Variant |
Optional |
|
Z coordinate of the second semi-axis, when the anisotropy type is General. |
AnisoGeneralThirdAxisX |
Variant |
Optional |
|
X coordinate of the third semi-axis, when the anisotropy type is General. |
AnisoGeneralThirdAxisY |
Variant |
Optional |
|
Y coordinate of the third semi-axis, when the anisotropy type is General. |
AnisoGeneralThirdAxisZ |
Variant |
Optional |
1/2 the Z range |
Z coordinate of the third semi-axis, when the anisotropy type is General. |
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. |
DataMetric |
Variant |
Optional |
|
This specifies one of the data metric options, 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). |
xSize |
Variant |
Optional |
|
This specifies the X spacing of the output grid. |
ySize |
Variant |
Optional |
|
This specifies the Y spacing of the output grid. |
zSize |
Variant |
Optional |
|
This specifies the Z spacing of the output grid. |
CLimitMinMethod |
Optional |
srfCLimitNone |
This provides the method for the output grid C minimum limit. Uses srfCLimitMethod. CLimitMinMethod must be srfCLimitCustom to use CLimitMin. |
|
CLimitMaxMethod |
Optional |
srfCLimitNone |
This provides the method for the output grid C maximum limit. Uses srfCLimitMethod. CLimitMaxMethod must be srfCLimitCustom in order to use CLimitMax. |
|
CLimitMin |
Double |
Optional |
This provides the output grid minimum C limit value when CLimitMinMethod = srfCLimitCustom. |
|
CLimitMax |
Double |
Optional |
This provides the output grid maximum C limit value when CLimitMaxMethod = srfCLimitCustom. |
|
CTransformMethod |
Optional |
srfCTransformLinear |
This provides the method to transform c data linearly or logarithmically. The SrfTransformMethod enumeration can be used for this parameter. |
|
SaveReportAs |
Variant |
Optional |
|
This specifies the path and file name to which the gridding report is saved. The Surfer application must be visible and ShowReport must be True to save the gridding report. |
ReportFormat |
Optional |
srfReportFormatRTF |
This specifies the format for the saved gridding report, TXT or RTF |
|
SaveSettingsAs |
String |
Optional |
Saves grid data settings from an .SRFGDS file. |
|
LoadSettingsAs |
String |
Optional |
Loads grid data settings to an .SRFGDS file. |
|
OutGrid |
String |
Optional |
"" |
This provides the path and file name of the output grid file. |
OutFmt |
Optional |
srfGridFmtVTK |
This provides the output grid file format. Only srfGridFmtVTK and srfGridFmtXYZC are supported. |
|
OutGridOptions |
String |
Optional |
"" |
This provides the output option string for the grid format. |
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. 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.
X spacing can be specified with either NumX or xSize. Y spacing can be specified with either NumY or ySize. Z spacing can be specified with either NumZ or zSize. However, if both NumX and xSize or NumY and ySize or NumZ and zSizeare specified, the script will result in an error.
The Surfer application must be visible and ShowReport must be set to True to save the gridding report with the SaveReportAs and ReportFormat parameters. The report is saved via the user interface functionality. Any errors in saving the report will happen via the user interface as well, and the error will block the script from proceeding.
Example
This example uses GridDataXYZC. The Grid Report was turned on in this example to display the correct sheet being used.
Dim SurferApp As Object
Set SurferApp = CreateObject("Surfer.Application")
SurferApp.Visible = True
Dim Doc As Object
Set Doc = SurferApp.Documents.Add(srfDocPlot)
SurferApp.GridDataXYZC(DataFile:=Data3DPath+"SampleDrillholeDataXYZC.xlsx", _
xcol:=1, ycol:=2, zcol:=7, ccol:=5, Algorithm:=1, IDPower:=5, IDSmoothing:=10, _
ShowReport:=True, OutGrid:=OutXYZCPath+"Sample_XYZC.vtk")
Used by: Application object