GridCalculus2

GridCalculus2 performs various calculus operations on an existing grid. It provides you with tools to interpret your grid files and creates a new grid file of the generated data. Returns a Boolean. It returns 'True' if the data are generated successfully, otherwise, it returns 'False'.

Syntax

object.GridCalculus2( InGrid, Operation, Param1, OutGrid, OutFmt, OutGridOptions )

Parameter

Type

Required/

Optional

Default

Description

InGrid

String

Required

 

This provides the path and file name of the input grid file.

Operation

SrfCalculusOp

Required

 

This specifies the type of grid calculus operation.

Param1

Double

Optional

 

See Remarks

 

OutGrid

String

Optional

""

This provides the path and file name of the output grid file name

OutFmt

SrfGridFormat

Optional

srfGridFmtS7

This provides the output grid file format.

OutGridOptions

String

Optional

""

This provides the output option string for the grid format.

Remarks

Param1 is the angle if Operation equals srfGCFirstDeriv, srfGCSecondDeriv, or srfGCCurvature. Param1 is the threshold if Operation equals srfGCAspect, srfGCProfCurv, srfGCPlanCurv, or srfGCTanCurv.

Example 1

This example demonstrates how to create a new grid corresponding to the various slopes within demogrid.grd by performing the terrain slope calculus operation.

SurferApp.GridCalculus2(InGrid:=SurferApp.Path+"\Samples\demogrid.grd", _

Operation:=srfGCSlope, OutGrid:="c:\temp\dgrid1.grd", _

OutFmt:=srfGridFmtS7)

Example 2

This example demonstrates how to create a new grid corresponding to the various slopes within Conifer.grd, save the file as Calculus.grd and save the spatial references as Golden Software Reference (GSIREF) version 1 and version 2 files.

Surfer.GridCalculus2(InGrid:=InGridPath+"Conifer.grd", Operation:=srfGCSlope, OutGrid:=OutGridPath + "Calculus.grd", OutGridOptions:="UseDefaults=1, ForgetOptions=1, SaveRefInfoAsGSIREF=1, SaveRefInfoAsGSIREF2=1")

Example 3

This script displays all the methods in the Application object.

Used by: Application object