Welcome to Golden Software Support

Surfer 10 C# Blanking data on GRD creation


1 comment

  • Avatar
    Kari Dickenson


    It sounds like it might not be the script, but the options specified in the script that are causing the errors. It looks like the options you are setting via the script are:

    Datafile = inFile, //local file name of the file I linked to above xCol=2, yCol= 1, zCol=3, ExclusionFilter = z < -80 OR z > 140 DupMethod = Surfer.SrfDupMethod.srfDupNone, xDupTol = null yDupTol = null NumCols = 2479 NumRows = 1381, xMin, xMax, yMin, yMax = left, right, top, bottom, //values from a config Algorithm = Surfer.SrfGridAlgorithm.srfKriging, ShowReport = false SearchEnable = true SearchNumSectors = 4, SearchRad1 = map.SearchRadius, //value from a config SearchRad2 = map.SearchRadius, SearchAngle = 0 SearchMinData = 8 SearchDataPerSect = 4 SearchMaxEmpty = 3 FaultFileName = null BreakFileName = null AnisotropyRatio = 1 AnisotropyAngle = 0 IDPower = null IDSmoothing = null,//30 KrigType = Surfer.SrfKrigType.srfKrigPoint, KrigDriftType = Surfer.SrfDriftType.srfDriftLinear, KrigStdDevGrid = null, KrigVariogram = new Surfer.IVarioComponent[] { AppSurfer.NewVarioComponent(Surfer.SrfVarioType.srfVarLinear,1,0,1,1,0) }, MCMaxResidual to RBR Squared = null,null,null,null,null,null,null,null, null,null,null,null,null,null,null, OutGrid = outGrid, //output filename for a grd file OutFmt = Surfer.SrfGridFormat.srfGridFmtS7, SearchMaxData = 32 KrigStdDevFormat = Surfer.SrfGridFormat.srfGridFmtS7, DataMetric, LocalPolyOrder, LocalPolyPower, TriangleFileName = null,null,null,null)


    That all works for me to grid the data in the user interface. The only question marks are these lines (since the actual values are not reported):

    xMin, xMax, yMin, yMax = left, right, top, bottom, //values from a config 
    SearchRad1 = map.SearchRadius, //value from a config
    SearchRad2 = map.SearchRadius


    I would check those actual values as they may not be appropriate for the data in the CSV. If the X and Y min/max values are outside the actual data values in the CSV file, then the entire grid would be blanked because there is no data in the specified range. If the search radius is too small, then perhaps you might have a similar situation where all nodes are blanked since no data points are within the search of the node location.

    I took out those 3 lines (and all the parameters with a null value) and ran it through the Surfer 10 automation Scripter program and it worked fine, so it is likely related to the data values for those parameters.

    Sub Main 
    Dim SurferApp As Object
    Set SurferApp = GetObject(, "Surfer.Application")
    SurferApp.Visible = True Dim Plot As Object
    Set Plot = SurferApp.Documents.Add
    Dim VarioComponent(1 To 1) As Object
    Set VarioComponent(1) = SurferApp.NewVarioComponent(srfVarLinear, 1,0,1,1,0)
    SurferApp.GridData(DataFile:="C:\temp\20151105_TMAX.csv", xCol:=2, yCol:= 1, zCol:=3, ExclusionFilter:= "z < -80 Or z > 140", DupMethod:= srfDupNone, NumCols:= 2479,NumRows:= 1381, Algorithm:=srfKriging, ShowReport:= False, SearchEnable:= True, SearchNumSectors:= 4, SearchAngle:= 0, SearchMinData:= 8, SearchDataPerSect:= 4, SearchMaxEmpty:= 3, KrigType:= srfKrigPoint, KrigDriftType:= srfDriftLinear, OutGrid:="c:\temp\outgrid.grd", OutFmt:=srfGridFmtS7, SearchMaxData:= 32, KrigVariogram:=VarioComponent)
    Dim MapFrame As Object
    Set MapFrame = Plot.Shapes.AddImageMap(GridFileName:="c:\temp\outgrid.grd")

    End Sub


    Thanks, Kari

    Comment actions Permalink

Please sign in to leave a comment.