Welcome to Golden Software Support

Comments

6 comments

  • Official comment
    Avatar
    Brittany Bodane

    Hi Lars,

     

    Thank you for your question. You can use GridExtract to specify the starting and ending rows and columns to extract from an existing grid file.  Using the Surfer sample data, DEMOGRID, as an example, extracting the top right of the existing grid would look as follows:

    SurferApp.GridExtract(InGrid:=SurferApp.Path+"\Samples\demogrid.grd", r1:=1, _

    r2:=26, c1:=1, c2:=25, OutGrid:=SurferApp.Path+"\Samples\dgrid1.grd", OutFmt:=srfGridFmtS7)

     

    Please see the GridExtract section of Surfer's online help for more information.

     

    Thanks!

    Brittany

     

     

    Comment actions Permalink
  • Avatar
    Lars Thomsen

    Thanks Brittany 

    If I want to split very large grids into a "matrix" of smaller grids, for instance 10x10=100 smaller grids - is this possible? 

    Is it possible to add a "buffer" of rows and/or columns to every smaller grid - in order to create an overlap between neighbors?

    If so... Which method do I need to do this?

    Hi from Lars

    0
    Comment actions Permalink
  • Avatar
    Brittany Bodane

    Hi Lars,

     

    To split a matrix of smaller grids you would use the script string from above, but do a little math to figure out where your smaller grids would start and end.  

    For example, if you have a starting grid of 1000x1000 and you want to split it into 100 smaller grids, your smaller grid would be as follows:

    Smaller grid 1 columns: 1-100; rows 1-100 | Smaller grid 2 columns 101-200; rows 1-100

    To add a buffer, add/subtract how many columns/rows to create the overlap you would like.  So, if you wanted your buffer to overlap 2 columns/rows, the above example would change to the following:

    Smaller grid 1 columns: 1-102; rows 1-102 | Smaller grid 2 columns 100-202; rows 1-102

     

    If you would like further help with your specific data please reach out to support@goldensoftware.com

     

    Thanks!

    Brittany

    0
    Comment actions Permalink
  • Avatar
    Lars Thomsen

    Hi Brittany 

    Thanks for your very thorough answers. 

    One last one... perhaps!

    Is it possible to call scripter from the command line and run the code?

    For instance by placing the code in a bas-file and run the code by calling scripter with the file as a parameter?

    0
    Comment actions Permalink
  • Avatar
    Lars Thomsen

    Sorry - I found this that explains most:

    https://support.goldensoftware.com/hc/en-us/articles/226625728-Can-I-run-a-Surfer-script-from-the-command-line-

    But how do I specify which sub in the bas-file to run? 

    And can I pass parameters to the bas-file - f.i. row- and col-numbers?

    1
    Comment actions Permalink
  • Avatar
    Brittany Bodane

     

    Hi Lars,

     

    All our example scripts are written using a single sub routine and we only offer application specific support for scripting. I recommend looking online for some examples of how this is done in BASIC.

     

    The knowledge based article, "How Can I Specify A Particular Excel Worksheet To Load Via Surfer Scripter?" can be used as an example of how you would pass parameters to the BAS file. 

     

    Thanks!

    Brittany

    0
    Comment actions Permalink

Please sign in to leave a comment.