Description
Collect selected scalar fields into vectors, with one output column per input group.
Synopsis
sgfieldout <stdin >stdout out.ns="ns" fields=
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
in |
ifile |
stdin
|
input data 1. all input vector fields are removed 2. all scalar fields are retained in the output dataset |
out |
ofile |
stdout
|
output data: 1. each field yields a new vector in output 2. each input group yields a new column in output |
out.ns |
str |
ns
|
name of the field containing the valid sample count for each group |
fields |
fields |
Unknown | scalar fields to convert into output vectors |
Input and output
Input
input data 1. all input vector fields are removed 2. all scalar fields are retained in the output dataset
Output
output data: 1. each field yields a new vector in output 2. each input group yields a new column in output
Examples
1. Collect receiver positions into vectors for each shot group
sgfieldout fields=gz,gx,gy <shots.sg >positions.sgInput must have scalar gz, gx and gy fields and consecutive shot groups.
Each input group becomes one output column; input vector fields are removed.
2. Collect amplitudes sampled at a field-defined vector index
sgfieldmath 'amp:f=data[slice]' <input.sg | \
sgfieldout fields=slice,amp >slice.sgInput needs a data vector and a scalar slice containing a valid zero-based index.
Output collects slice and amp per input group; this does not convert index to time.
3. Regroup by an index field before collecting receiver coordinates
sgattribute group=index <input.sg | sgfieldout fields=gz,gx >positions.sgInput needs scalar index, gz and gx fields. Consecutive equal index values form
groups; one column results per such group, not necessarily for the whole dataset.
Ensure group-size metadata covers the regrouped data and inspect output shapes.