{
    "command": "sgfieldout",
    "description": "Collect selected scalar fields into vectors, with one output column per input group.",
    "examples": [
        {
            "command": "sgfieldout fields=gz,gx,gy <shots.sg >positions.sg",
            "expected": "Input must have scalar gz, gx and gy fields and consecutive shot groups.\nEach input group becomes one output column; input vector fields are removed.",
            "title": "Collect receiver positions into vectors for each shot group"
        },
        {
            "command": "sgfieldmath 'amp:f=data[slice]' <input.sg | \\\n  sgfieldout fields=slice,amp >slice.sg",
            "expected": "Input needs a data vector and a scalar slice containing a valid zero-based index.\nOutput collects slice and amp per input group; this does not convert index to time.",
            "title": "Collect amplitudes sampled at a field-defined vector index"
        },
        {
            "command": "sgattribute group=index <input.sg | sgfieldout fields=gz,gx >positions.sg",
            "expected": "Input needs scalar index, gz and gx fields. Consecutive equal index values form\ngroups; one column results per such group, not necessarily for the whole dataset.\nEnsure group-size metadata covers the regrouped data and inspect output shapes.",
            "title": "Regroup by an index field before collecting receiver coordinates"
        }
    ],
    "input_description": "input data \n1. all input vector fields are removed\n2. all scalar fields are retained in the output dataset",
    "notes": [],
    "output_description": "output data:\n1. each field yields a new vector in output\n2. each input group yields a new column in output",
    "package": "sigclear-soig",
    "parameters": [
        {
            "choices": [],
            "default": "stdin",
            "default_known": false,
            "description": "input data \n1. all input vector fields are removed\n2. all scalar fields are retained in the output dataset",
            "name": "in",
            "required": false,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": "stdout",
            "default_known": false,
            "description": "output data:\n1. each field yields a new vector in output\n2. each input group yields a new column in output",
            "name": "out",
            "required": false,
            "type": "ofile",
            "units": null
        },
        {
            "choices": [],
            "default": "ns",
            "default_known": true,
            "description": "name of the field containing the valid sample count for each group",
            "name": "out.ns",
            "required": false,
            "type": "str",
            "units": null
        },
        {
            "choices": [],
            "default": null,
            "default_known": false,
            "description": "scalar fields to convert into output vectors",
            "name": "fields",
            "required": null,
            "type": "fields",
            "units": null
        }
    ],
    "related": [],
    "schema_version": 1,
    "summary": "Collect selected scalar fields into vectors",
    "synopsis": "sgfieldout <stdin >stdout out.ns=\"ns\" fields=",
    "version": "1.1.1-4"
}