SIGCLEAR Program reference

sgfieldout

Collect selected scalar fields into vectors

Package: sigclear-soig · Version: 1.1.1-4 Download JSON

Description

Collect selected scalar fields into vectors, with one output column per input group.

Synopsis

sgfieldout <stdin >stdout out.ns="ns" fields=

Parameters

sgfieldout parameters
ParameterTypeDefaultDescription
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.sg

Input 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.sg

Input 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.sg

Input 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.