PICScript - Surface Declarations

All inputs, output, and temporary variables must be "declared" in your PICScript. All declarations are made at the beginning of the script. Functions follow the declaration section. Functions are constructed using the aliases declared at the beginning of the script. Declarations may be made by selecting items from the Inputs/Outputs tab of the dialog box or by simply typing into the PICScript text window.

Note that the easiest way to write scripts is to construct function statements and declarations at the same time using the Inputs/Outputs tab. As you construct functions by selecting inputs and outputs, PICScript will make automatic declarations for you. Please see Building PICScripts Click by Click for details.

Input Surface Declaration Example

OR

Declaration Syntax

Input Declaration Syntax

The line below declares an input surface.

surfacein Nisku from time as deeper;

The first word, surfacein, tells the compiler this is an input surface. The next word, Nisku. is the name of the horizon or grid (surface) to use. from time indicates that this is a time value. as deeper specifies the alias that will be used in script functions to represent the Nisku time. The semicolon marks the end of the declaration statement.

The line below declares an accumulation variable.

global sum = 0;

The first word, global, tells the compiler to define a temporary location in memory to store the results of a computation. The next word, sum, is the alias that will be used in script functions to represent the variable. A variable must have an initial value. In this example, the = 0 portion of the declaration sets the variable to zero. The semicolon marks the end of the declaration statement.

The line below declares a  temporary surface.

Surfacetemp smoothgrid;

The first word, surfacetemp, tells the compiler to define a temporary surface to store the results of a computation. The next word,smoothgrid, is the alias that will be used in script functions to represent the surface.

Output Declaration Syntax

The line below declares an output surface.

output amp;

The first word, output, tells the compiler this is an output surface. The next word amp, specifies the type of output. This is also the alias that will be used in script functions to represent the output surface. The semicolon marks the end of the declaration statement.

The results of your script will be entered into the grid database or the horizon database. The grid database can accommodate time, amplitude, interval velocity, average velocity, and depth. When your results do not fit into one of these categories select amplitude as your output attribute (type). The horizon database can accommodate time, amplitude, or both time and amplitude. When your results do not fit into one of these categories, select amplitude.

Related Topics