|
<< Click to Display Table of Contents >> Navigation: Math > Expression calculator |
Perform mathematical operations between gathers
![]()
![]()
Expression calculator is a handy module to perform any mathematical and logical operations. With the help of this module, the user can do some of the mathematical operations like simple addition, subtractions to complex mathematical expressions.
The module takes one or more input gathers with same size and creates a new gather in which, value for each sample is a result of calculated expression defined by the user. Input gathers can be used as operands in this expression.
![]()
![]()
![]()
![]()
This module uses C++ Mathematical Expression Toolkit Library (ExprTk) for calculation. It can contain mathematical operators, functions etc;
ExprTk library has the following capabilities:
•Mathematical operators (+, -, *, /, %, ^)
•Functions (min, max, avg, sum, abs, ceil, floor, round, roundn, exp, log, log10, logn, root, sqrt, clamp, inrange)
•Trigonometry (sin, cos, tan, acos, asin, atan, atan2, cosh, cot, csc, sec, sinh, tanh, d2r, r2d, d2g, g2d, hyp)
•Equalities, Inequalities (=, ==, <>, !=, <, <=, >, >=)
•Boolean logic (and, mand, mor, nand, nor, not, or, xor, xnor)
•Control Structures (if-then-else, ternary conditional, switch case)
Documentation for ExprTk is available here: https://www.partow.net/programming/exprtk/index.html
Note: When the user works with the expression calculator, the user should pay attention to the mathematical expression. In the mathematical expression, the user can't use the combination of one gather and one matrix inside the mathematical expression. Either it should be completely gather or matrix but not both.
For example, the user tries to update the trace headers (BIN_PICKET) with a scalar value which the user generated by using Interpolate headers from matrix module. In the expression calculator, the user should provide the Input gather A only and should not provide the matrix however in the mathematical expression, the user should write the expression as a*a_header_name. Here a_header_name is nothing but the Gather A with the interpolated trace header (a_bin_picket) which was previously updated in the previous module i.e., Interpolate headers from Matrix.
![]()
![]()
![]()
![]()
![]()
![]()
In this example, we are working on a shot gather where we would like to calculate the amplitude relationship function of an AGC (Automatic Gain Control) applied shot gather. Later, we would like to take off this AGC by using the expression calculator.

In the 1st expression calculator, we connect/reference the Input gather of AGC as Input Gather A and Output Gather of AGC as Input Gather B.


Now, we'll define the mathematical expression as "a/b". This will gives us a Output gather. This output is the amplitude relation function.

In the second expression calculator module, we use Output gather of AGC module as Input Gather A and Output gather of Expression calculator 1 as Input Gather 2 and define the mathematical expression.


Now in the 2nd Expression calculator mathematical expression, we define the expression as "a*b". This will gives us the output gather without any AGC applied. In other words, the original input gather before the application of AGC.

To make sure that the original input and the output from the 2nd Expression calculation is same, we can add additional expression calculator and do a simple mathematical subtraction. It should give zero response.



There is another example where the user wants to apply scalars to the input seismic file by using expression calculator.



In the above expression, "a" denotes the input gather (A/a) and "a_bin_picket" is the nothing but the trace header bin_picket which has the updated scalar values (by using Interpolate headers from matrix module shown below image)

![]()
![]()
There are no action items are available for this module so the user can ignore it.
![]()
![]()
YouTube video lesson, click here to open [VIDEO IN PROCESS...]
![]()
![]()
Yilmaz. O., 1987, Seismic data processing: Society of Exploration Geophysicist
* * * If you have any questions, please send an e-mail to: support@geomage.com * * *