You are here: Working with the Application Toolbar > Interpret Data > PICScript > PICScript Surface Functions

PICScript Surface Functions

PICScript programs let you create new grids or horizon values from existing grids, horizons, or attributes extracted over a seismic time window. Programs, called scripts, use Surface Functions to handle data. There are two kinds of surface functions - function blocks and whole surface functions. A script contains one or more surface functions. The results of one function can be used as an input to another function.

Surfaces are grids or values stored in the horizon data base. Statements declared inside a func{ } function block make calculations on a point by point basis to construct a new surface. Whole surface functions incorporate values from neighboring points into their calculations.

Function blocks

Function blocks are used to group program statements for execution. With the exception of whole surface functions (smoothing, azimuth, and dip), all statements must be enclosed in a function block. That is, they are introduced by func, and all statements are enclosed in the associated function brackets ( { } ).

A function block may contain one statement or a series of related statements. Statements in a function block are executed on each grid cell or horizon value in turn. For example, given a function block in a grid script, the first statement in the function block is executed on the first cell of the grid. The second statement is executed on the first cell. The next statement is executed on the first cell .... etc. Until all statements in the function block have been executed. Then the process is repeated for the second cell of the grid. In other words: The first statement in the function block is executed on the second cell of the grid, and so on.

Note that the entire function block is considered a surface function. Surface functions may not be nested. That is, a surface function may not contain another surface function.

Whole surface functions

Whole Surface Functions must not be included in a function block. These special functions are designed to use information from more than one cell to compute values. Smoothing, Azimuth, and Dip (or magnitude of change) are all whole surface functions.

Enter a whole surface function on a separate line of the script outside of a function block.

Example Script

This script finds the time of the smallest amplitude over a window of seismic time and extracts the amplitude at that time. It then smooths the time results. Time and amplitude are written to a new horizon. The user provides the output horizon name at run time.

Lines starting with "//" are Comment Lines. Comment lines are notes added by a programmer to make the script easier to understand. They are ignored by the computer. In the example script below, you will find comment lines that annotate the declaration and function sections of the script. In the function section you will see two surface functions. The first is a function block containing the mintime and amplitude functions. The second is a whole surface function (smooth).

// DECLARATION SECTION

surfacein Carling from time as wrong_polarity;

seismic default attribute iseis as Data;

output amp;

output time;

// FUNCTION SECTION

func{

time = mintime(Data , wrong_polarity - 20, wrong_polarity);

amp = amplitude (Data, time);

}

// note that the smooth function is not in a function block

time = smooth (time,3,mean);

What do you want to do?