Modification of traces headers by using expressions/equations etc.
Seismic traces store all geometry, navigation and other parameters information in the trace headers. Trace headers holds the key information which can be extracted anytime during the entire seismic processing life cycle. If there is a situation where the trace headers needs to corrected, we need have a tool to edit/modify the existing trace headers. Also, this tool should not replace the original trace headers information but keep a copy of the original trace headers and create a duplicate copy of the original trace headers.
This module edits/modifies the trace headers. In this module the user can able to perform many mathematical operations to modify the trace headers. It can be useful in doing all sorts of mathematical operations by means of mathematical expressions to change/manipulate the trace headers.
Below, we are storing the travel time values into TRACE_STATIC header. This TRACE_STATIC header value will be used later in the processing workflow.
If the above expression can be written as mathematical equation,
In the expression, if the result of multiplication of SOURCE_DEPTH with not equals then it will replace the value with Zero (0) otherwise it will take the value calculated from the expression .
g-Platform uses following mathematical expressions in writing an equation/expression
•Loop Structures (while loop, for loop, repeat until loop, break, continue).
Work mode { Trace headers, Trace headers on disk, Gather } - Selects the type of input data and the processing strategy. Choose the mode that matches how the seismic data is available in your workflow. Each mode activates a different set of input connection items.
WorkMode - Gather - Processes one gather at a time. Use this mode when the module is placed inside a seismic processing loop (Seismic Loop module), where each iteration delivers a single CDP or shot gather. This is the correct mode for real-time gather-by-gather header editing during iterative processing. The output is a full gather with modified headers and the seismic data matrix preserved.
Input gather - connect/reference to the input gather.
WorkMode - Trace headers - Operates on a trace header vector already loaded into memory. Connect the Trace headers output from a preceding module (such as Load geometry or Get Trace headers) to the Trace headers input item. This is the most common mode for batch header editing of an entire dataset after geometry loading. The full trace vector is processed at once and the modified header vector is passed to the output.
Trace headers input - connect/reference to input trace header vector.
WorkMode - Trace headers on disk - Processes seismic data directly from disk, reading and writing in batches, without loading the entire dataset into memory. Use this mode for very large datasets where the full trace vector would exceed available RAM. Connect the Input traces data handle from an "Open seismic traces" module, specify an output GSDL file path, set the Input data type, and tune the Header bulk size. The module streams through the data in chunks, applies expressions to each chunk, and writes the result to the new output file.
Input traces data handle - connect/reference to Output traces data handle.
Trace header input - connect/reference to the input traces header vector.
Optional: These are optional parameters. Depending on the requirement, the user can provide the input data information.
Input calculated attributes - Optional connection. Accepts a per-trace attribute matrix produced by a module such as QC Attributes Per Trace. When connected, each attribute value is matched to the corresponding trace and its name becomes available as a variable inside the Trace headers expression column. For example, if the connected attribute is named RMS_AMPLITUDE, you can write an expression such as RMS_AMPLITUDE * 0.001 in the DATA_USE header row to store a scaled amplitude value in that header field. Attribute matching is performed per source, receiver, and bin, so an attribute computed on one trace applies to all traces sharing the same geometry entity.
In this, we are calculating RMS Amplitudes by using QC attributes per trace module and calling the RMS_AMPLITUDE information in Header manipulation and storing it in DATA_USE trace header.
External expression collection - An optional list of constant string values (up to 10 entries) that can be referenced inside the Trace headers expressions as numbered placeholders. Each string in the list is assigned a positional variable: the first entry is referenced as $1, the second as $2, and so on. This is useful when the same numeric constant or sub-expression appears in multiple header formulas — you define it once in this list and reference it by placeholder throughout the expression table, making it easy to update a shared value in a single place rather than editing every row individually.
These strings can be used inside the Trace headers as a variable by using "$" sign. In the above image, String 1 will be recognized as $1, string 2 will be recognized as $2
Trace headers - The main editing table. All trace headers available in the input dataset are listed, grouped into four categories: trace-level headers, source headers, receiver headers, and bin headers. Each row has three columns:
Header — the name of the trace header field (read-only, populated automatically from the input data).
Remove — check this box to delete the custom (additional) header field entirely from the dataset. This is only applicable to user-defined additional headers; standard geometry headers cannot be deleted.
Expression — enter a mathematical formula to compute a new value for this header. The expression can reference any other header name by its exact field name (for example, SOURCE_X, CDP_X, OFFSET), combine them with arithmetic operators, apply built-in functions, or use conditional logic. Rows with an empty expression and the Remove box unchecked are skipped; only rows with a non-empty expression or Remove checked are processed. If External expression collection variables are defined, reference them with $1, $2, etc. within expressions. If Input calculated attributes are connected, reference an attribute by its name as it appears in the attribute list.
Advanced
Unsafe - By default, FALSE (unchecked). When set to FALSE, the module works on a copy of the input trace headers, leaving the original data untouched. The modifications are written to a new trace header vector that is passed downstream. When set to TRUE (unsafe mode), the module writes changes directly into the original input trace headers without making a protective copy. This is faster and uses less memory, but means the original header values are permanently overwritten. Use TRUE only when you are certain you do not need to preserve the original values, for example inside a gather loop where performance is critical.
Note: when Unsafe is TRUE and the trace vector needs to be rebuilt (because expressions reference headers from a different category, such as a bin header being set from a source header), the module performs a full rebuild and then swaps the result back into the original trace vector object. The output is the modified input object rather than a separate clone.
Always rebuild trace vector - By default, FALSE (unchecked). Controls whether the module reconstructs the trace vector from scratch before applying expressions. When FALSE, the module automatically detects whether a rebuild is necessary based on the expression content. A rebuild is triggered automatically when an expression for one header category references headers from a different category — for example, setting a bin header (CDP_X, CDP_Y) to a value derived from source or receiver headers. When TRUE, a rebuild is forced regardless of the expressions used. Enable this option if you experience unexpected results with cross-category header assignments or if you have added or removed custom (additional) headers from the dataset.
Rebuild sequence numbers - By default, TRUE (checked). After header modification, g-Platform re-indexes the internal sequence numbers for sources, receivers, and bins so that the dataset's internal structure stays consistent with the updated header values. Disable this option only in special cases where you need to preserve existing sequence numbering, for example when re-merging datasets and the original numbering must remain intact.
Set line name by survey ID - Optional. A mapping table that associates a numeric Survey ID with a human-readable line name. Add one row per survey, entering the Survey ID (integer, 0–16000) and the corresponding line name string. This information is stored inside the .GSD project file and does not appear as a regular trace header field, but it is used by g-Platform to label lines correctly when multiple surveys are present in the same project. Use this table when merging data from different acquisition lines or surveys into a single dataset and you need each line to carry an identifiable name.
Input data { Stack, Pre-stack } - Visible only in Trace headers on disk mode. Specifies whether the on-disk seismic file contains stacked (post-stack) or pre-stack data. Default is Stack. This setting controls how the expression engine resolves header scope: for Stack data, expressions evaluate at the post-stack (no source-receiver distinction) level; for Pre-stack data, expressions evaluate with full source-receiver-bin awareness. Set this to match the actual acquisition type of the connected seismic file.
Header bulk size - Visible only in Trace headers on disk mode. Default: 10,000 traces. Sets the number of traces loaded into memory at one time when processing a large on-disk seismic file. The module reads the file in sequential batches of this size, applies the header expressions to each batch, and writes the modified headers to the output file before loading the next batch. Increase this value on machines with more available RAM to reduce the number of disk read passes and speed up processing. Reduce it if memory is limited. For most datasets the default of 10,000 is a good starting point.
Output seismic file name - specify the output seismic file name. This option is only available when the input data type is Trace headers on disk option.
Auto-connection - By default, TRUE(Checked).It will automatically connects to the next module. To avoid auto-connect, the user should uncheck this option.
Number of threads - One less than total no of nodes/threads to execute a job in multi-thread mode. Limit number of threads on main machine.
Skip - By default, FALSE(Unchecked). This option helps to bypass the module from the workflow.
Output DataItem
Output gather - Available in Gather work mode only. Passes the gather with updated trace headers to the next module in the seismic processing loop. When Unsafe is FALSE, a new gather object is constructed containing the modified trace vector and a clone of the input seismic data matrix, preserving the original gather unchanged. When Unsafe is TRUE, the original input gather object is passed through directly after in-place modification.
Modified trace headers - The output trace header vector with all expression-based modifications applied. Connect this output to downstream modules that require updated header values, such as sorting, stacking, or export operations. In Trace headers and Gather work modes, this output is always produced. In Trace headers on disk mode, the modified headers are written directly into the output seismic file (GSDL format) and the in-memory trace header output is not used.
This module doesn't have any action items so the user can ignore it.
Use any of the mathematical operations to create their own equation/expression. In this example, FFID values are replaced from SOURCE_SP. Likewise, Source Elevations (SOURCE_ELVE) are multiplied by 10.