{
    "command": "sgfieldin",
    "description": "Compare fields in the input and auxiliary datasets using the configured\nmatching conditions, then copy selected auxiliary fields into the output when\nthose conditions match. Define explicit field mappings and comparison\nconditions; the resulting fields are added to the input dataset's schema.",
    "examples": [
        {
            "command": "sgfieldin -aux=auxiliary.sg swath==swath shot==spnb \\\n  shotx=sx shoty=sy firetime=ft_us <input.sg >output.sg",
            "expected": "input.sg must contain scalar swath and shot fields. auxiliary.sg must contain\nscalar swath, spnb, sx, sy and ft_us fields, with its columns in one group.\nFor matching input columns, output.sg retains the original fields and imports\nauxiliary sx, sy and ft_us values into scalar shotx, shoty and firetime fields.\nCheck the flag field and imported values before further processing. File names\nare illustrative; this example has not been executed against a supplied dataset.",
            "title": "Import shot coordinates and fire time for matching swath and shot values"
        }
    ],
    "input_description": "input data",
    "notes": [],
    "output_description": "output dataset: selected scalar and vector values from the auxiliary file are imported as scalar fields",
    "package": "sigclear-soig",
    "parameters": [
        {
            "choices": [],
            "default": "stdin",
            "default_known": false,
            "description": "input data",
            "name": "in",
            "required": false,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": null,
            "default_known": false,
            "description": "auxiliary data:\n1. multiple columns must be in the same group;\n2. both scalar and vector fields can be used as check conditions;\n3. both scalar and vector fields can be imported as new fields",
            "name": "-aux",
            "required": null,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": "stdout",
            "default_known": false,
            "description": "output dataset: selected scalar and vector values from the auxiliary file are imported as scalar fields",
            "name": "out",
            "required": false,
            "type": "ofile",
            "units": null
        },
        {
            "choices": [],
            "default": "flag",
            "default_known": true,
            "description": "status field name:\n1. stores the index of the matched column in the auxiliary file\n2. stores -1 when no auxiliary column matches",
            "name": "-flag",
            "required": false,
            "type": "str",
            "units": null
        }
    ],
    "related": [],
    "schema_version": 1,
    "summary": "Import auxiliary fields when specified matching conditions are satisfied",
    "synopsis": "sgfieldin <stdin -aux= >stdout -flag=\"flag\"",
    "version": "1.1.1-4"
}