SIGCLEAR Program reference

sgfieldin

Import auxiliary fields using numeric matching conditions

Package: sigclear-soig · Version: 1.2.2 Download JSON

Description

Use INPUT==AUX mappings to compare real numeric input scalars with auxiliary
scalars or vector samples. Matching retains the first candidate whose summed
squared difference is less than 0.001. Use OUTPUT=AUX mappings to import numeric
scalars, selected numeric/complex vector samples, or complete fixed-width text.
Text is metadata, not a numeric lookup key. The auxiliary dataset must contain
one nonempty group. Without scalar conditions its first column is used; without
any conditions numeric vector samples are selected by input column index.

Each invocation accepts at most 100 matching conditions (INPUT==AUX) and,
separately, 100 import mappings (OUTPUT=AUX). Scalar and vector conditions count
together; all import types share the separate import limit. Unmapped dataset
fields do not count. These limits do not cap dataset columns or vector samples.
Exceeding either mapping limit is an error, not silent truncation.

A nonnegative flag indicates a match; -1 indicates no match. Unmatched columns
retain original input fields and leave newly added fields zero/empty, never
values from a prior match. Numeric zeros in unmatched fields are placeholders;
inspect the flag before analysis. Existing destinations must have exactly the
imported type and width.

Synopsis

sgfieldin <stdin -aux= -flag="flag" >stdout

Parameters

sgfieldin parameters
ParameterTypeDefaultDescription
in ifile stdin input dataset; numeric matching conditions require scalar input fields
-aux (required) ifile No default auxiliary dataset: exactly one nonempty group; numeric keys and values or fixed-width text metadata
-flag str flag match status field: -1: no complete match; new fields are zero/empty, not valid measurements vector conditions: zero-based matched sample index scalar-only conditions: zero on success no conditions: zero-based input column index
out ofile stdout output dataset retaining original input fields, with imported numeric/complex scalar values, complete fixed-width text and the match-status field

Input and output

Input

input dataset; numeric matching conditions require scalar input fields

Output

output dataset retaining original input fields, with imported numeric/complex scalar values, complete fixed-width text and the match-status field

Examples

1. Import shot coordinates and fire time for matching swath and shot values

sgfieldin -aux=auxiliary.sg swath==swath shot==spnb \
  shotx=sx shoty=sy firetime=ft_us <input.sg >output.sg

input.sg must contain scalar swath and shot fields. auxiliary.sg must contain
scalar swath, spnb, sx, sy and ft_us fields, with its columns in one group.
For matching input columns, output.sg retains the original fields and imports
auxiliary sx, sy and ft_us values into scalar shotx, shoty and firetime fields.
Check flag >= 0 before using imported measurements. Names are illustrative.

2. Attach fixed-width sample labels using a numeric sample ID

sgfieldin -aux=labels.sg id==id label=name <input.sg >output.sg

Both datasets must contain a real numeric scalar id. Auxiliary name is a
fixed-width text field; output label preserves its complete type and width.
No string matching or character-by-character sample lookup is performed.