Welcome to Golden Software Support

How to apply Gaussian filter by Scripter?



  • Avatar
    Leslie McWhirter

    Hi Vitality,

    You can use the GridFilter method to apply a Gaussian filter to your grid, and then loop through the grid files in a directory to perform the operation on many grids.

    If you want to define grid geometry like NumCols and NumRows (number of nodes in X and Y directions), you can use the GridData3 method. If you want to return those values after you have created the grid, you can use a script like this to call the NumCols/NumRows or xSize/ySize properties for the grid:

    Sub Main

     Dim SurferApp As Object
     Set SurferApp = CreateObject("Surfer.Application")

    'Load the grid
     Dim Grid As Object
     Set Grid = SurferApp.NewGrid
     Grid.LoadFile(FileName:=SurferApp.Path+"\samples\demogrid.grd", HeaderOnly:=False)

    'Returns the size of the grid cells (the grid spacing) in data units
     Debug.Print "xSize:"; Grid.xSize
     Debug.Print "ySize:"; Grid.ySize

    'Returns the number of grid rows and columns in the grid file
     Debug.Print "Number of Columns:"; Grid.NumCols
     Debug.Print "Number of Rows:"; Grid.NumRows

    End Sub



    Comment actions Permalink
  • Avatar

    Thank you very much! That's what I need!

    Comment actions Permalink

Please sign in to leave a comment.