{
    "command": "sginterp",
    "description": "Interpolate selected fields from an auxiliary dataset at the coordinates in\nthe input dataset. Use inverse-distance weighting for multidimensional keys,\nor one-dimensional linear/previous/next/nearest joins for a single key.\n\nInterpolation options:\n1. suitable for unstructured data \n2. IDW for multi-dimensional data \n3. linear, previous, next, and nearest joins for a one-dimensional key\n\nFor linear, previous/hold, next, and nearest interpolation, exactly one in.*\nfield is required. Auxiliary keys are sorted internally. The outside option is\nclamp, zero, or error. The duplicate option is error, first, last, or mean.\nNearest chooses the previous sample when distances are equal. IDW remains the\ndefault and retains support for multiple interpolation dimensions.\n\nIDW requires finite coordinates/values, a positive finite radius and positive\nfinite dimension weights. A query with no positive-weight auxiliary point\ninside the radius is an error, not a NaN result. The old radius option is a\ndeprecated alias for idw.radius and emits a warning; supplying both is an error.\nUnknown parameter names are rejected before processing.",
    "examples": [
        {
            "command": "sginterp aux=reference.sg in.depth=z out.data=vel out.temperature=temp \\\n  <input.sg >interpolated.sg",
            "expected": "Input depth is the query coordinate; auxiliary z is the reference coordinate.\nAuxiliary vel and temp values become output data and temperature using IDW.\nKeep all auxiliary columns in one group and verify coordinate units and ranges.",
            "title": "Interpolate velocity and temperature onto input depths"
        },
        {
            "command": "sginterp aux=reference.sg in.recx=x in.recy=y out.wdepth=data \\\n  <receivers.sg >depths.sg",
            "expected": "Input recx/recy query auxiliary x/y; auxiliary data becomes output wdepth.\nUse compatible coordinate units, one auxiliary group and appropriate IDW weights.",
            "title": "Interpolate ocean-bottom depth onto receiver positions"
        },
        {
            "command": "sginterp aux=models.sg out.data=var in.p1=m1 in.p2=m2 in.p3=m3 \\\n  in.p4=m4 in.p5=m5 <queries.sg >interpolated.sg",
            "expected": "Input p1 through p5 query auxiliary m1 through m5; var becomes output data.\nKeep auxiliary cases in one group and choose dimension weights for their units.",
            "title": "Interpolate a variable in a five-dimensional sampled model space"
        },
        {
            "command": "sginterp in.time=time aux=reference.sg out.value=value method=linear \\\n  <queries.sg >interpolated.sg",
            "expected": "Exactly one input coordinate field is required. Auxiliary keys are sorted;\nthe default outside policy clamps and the default duplicate policy rejects.\nThese illustrative invocations require matching datasets and output checks;\nthey are not evidence of executed or scientifically validated experiments.",
            "title": "Linearly interpolate values at irregular one-dimensional coordinates"
        }
    ],
    "input_description": "input dataset",
    "notes": [],
    "output_description": "output dataset",
    "package": "sigclear-dsp",
    "parameters": [
        {
            "choices": [],
            "default": "stdin",
            "default_known": false,
            "description": "input dataset",
            "name": "in",
            "required": false,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": null,
            "default_known": false,
            "description": "auxiliary dataset with all columns in one group",
            "name": "aux",
            "required": true,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": "AUX(x)",
            "default_known": false,
            "description": "index fields",
            "name": "in.x",
            "required": null,
            "type": "field",
            "units": null
        },
        {
            "choices": [],
            "default": "AUX(var)",
            "default_known": false,
            "description": "variable fields",
            "name": "out.var",
            "required": null,
            "type": "field",
            "units": null
        },
        {
            "choices": [
                "idw",
                "linear",
                "previous",
                "hold",
                "next",
                "nearest"
            ],
            "default": "SG_METHOD_IDW",
            "default_known": false,
            "description": "interpolation method; non-IDW methods require one interpolation field",
            "name": "method",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [],
            "default": "1.0",
            "default_known": false,
            "description": "relative weighting for each interpolation dimension",
            "name": "idw.eps",
            "required": null,
            "type": "floats",
            "units": null
        },
        {
            "choices": [],
            "default": 1000000,
            "default_known": true,
            "description": "maximum weighted interpolation distance",
            "name": "idw.radius",
            "required": false,
            "type": "float",
            "units": null
        },
        {
            "choices": [],
            "default": null,
            "default_known": false,
            "description": "deprecated compatibility alias for idw.radius; warns when supplied",
            "name": "radius",
            "required": null,
            "type": "float",
            "units": null
        },
        {
            "choices": [
                "clamp",
                "zero",
                "error"
            ],
            "default": "SG_TEMPORAL_CLAMP",
            "default_known": false,
            "description": "behavior outside the auxiliary key range",
            "name": "outside",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [
                "error",
                "first",
                "last",
                "mean"
            ],
            "default": "SG_TEMPORAL_DUPLICATE_ERROR",
            "default_known": false,
            "description": "behavior for duplicate auxiliary keys",
            "name": "duplicate",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [],
            "default": "stdout",
            "default_known": false,
            "description": "output dataset",
            "name": "out",
            "required": false,
            "type": "ofile",
            "units": null
        }
    ],
    "references": [
        "Shepard, Donald. 1968. A two-dimensional interpolation function for\nirregularly-spaced data. Proceedings of the 1968 ACM National Conference.\npp.517-524."
    ],
    "related": [],
    "schema_version": 1,
    "summary": "Interpolate fields from an auxiliary dataset",
    "synopsis": "sginterp <stdin aux= in.x=AUX(x) out.var=AUX(var) method=SG_METHOD_IDW idw.eps=1.0 idw.radius=1000000 radius= outside=SG_TEMPORAL_CLAMP duplicate=SG_TEMPORAL_DUPLICATE_ERROR >stdout",
    "version": "1.2.1"
}