SE_Weekley_Goodrich_Cornman — Neighbor-Depth Phase-Space Outlier Filter (WGC Tool)
SE_Weekley_Goodrich_Cornman (code/SE/SE_Weekley_Goodrich_Cornman.c, code/SE/SE_Weekley_Goodrich_Cornman.h) implements the "WGC Tool" (sub_window[59..61]) in swathed. Authored by Jonathan Beaudoin (February 2011) after the Weekley–Goodrich–Cornman lag-1 scatter/phase-space outlier detection method, it plots adjacent sounding depths against one another—$z(b, p)$ vs. $z(b, p+1)$ along-track and $z(b, p)$ vs. $z(b+1, p)$ across-track—and flags soundings whose orthogonal distance from the 1:1 identity line ($y = x$, slope $45^\circ$) exceeds a configurable threshold (weekley_filter_width).
Window Architecture (sub_window[59..61])
Clicking the WGC icon (icon_window[17]) on the main swathed toolbar calls view_weekley_box(), which creates top-level container sub_window[59] (306 × 609 px, titled "WGC Tool") in the bottom-right corner of the display containing two 300×300 pixel phase-space scatterplots:
| Sub-Window | Plot Title | Horizontal Axis ($x$) | Vertical Axis ($y$) | Description |
|---|---|---|---|---|
sub_window[60] | Beam filter (Along-Track Lag-1) | Depth $z(j, i)$ at beam $j$, ping $i$ (box[j][i]) | Depth $z(j, i+1)$ at beam $j$, ping $i+1$ (box[j][i+1]) | Plots every unflagged adjacent along-track sounding pair across the 80 loaded swaths (SE_NO_SWATHS). |
sub_window[61] | Swath filter (Across-Track Lag-1) | Depth $z(j, i)$ at beam $j$, ping $i$ (box[j][i]) | Depth $z(j+1, i)$ at beam $j+1$, ping $i$ (box[j+1][i]) | Plots every unflagged adjacent across-track sounding pair across all beams (SE_NO_MAX) in the 80 swaths. |
Both scatterplots auto-scale their axes (x_min, x_max, y_min, y_max) to match the active depth range of the main swathed window (fabs(graphic_param[0].y_max) to fabs(graphic_param[0].y_min)).
Mathematical Formulation & Filtering Algorithm
1. Orthogonal Distance to the $45^\circ$ Identity Line (plot_weekley_box)
On a continuous seafloor with small ping-to-ping and beam-to-beam depth changes, adjacent depth pairs $(z_1, z_2)$ cluster tightly along the $45^\circ$ diagonal $z_2 = z_1$. For each valid, unflagged neighbor pair (box[j][i] > 0 and neighbor > 0), plot_weekley_box() computes the perpendicular Euclidean distance $d_\perp$ from $(z_1, z_2)$ to the diagonal line connecting (x_min, y_min) and (x_max, y_max):
- Pairs with $d_\perp \le \text{weekley_filter_width}$ are plotted as
GREENcrosses. - Outlier pairs with $d_\perp > \text{weekley_filter_width}$ are plotted as
REDcrosses outside the twoMAGENTAacceptance envelope lines ($y = x \pm \text{weekley_filter_width} / \sin 45^\circ$).
2. Two-Pass Outlier Flagging (do_weekley_filter)
Pressing the w key while the cursor is inside the main across-track editing window (graphic_window[1]) invokes do_weekley_filter():
- Undo State Preservation: Calls
shift_undo_flags()so the entire WGC filter pass can be reversed withu(Undo). - Across-Track Pass (
Swath filter): For each swath $i \in [0, \text{SE_NO_SWATHS}-1]$, evaluates $d_\perp$ between adjacent beamsbox[j][i]andbox[j+1][i]. Whenever $d_\perp > \text{weekley_filter_width}$, bothweekley_flags[j]andweekley_flags[j+1]are marked, and all marked soundings are negated (box[j][i] = -box[j][i],box_flags[j][i]++,some_flagged++). - Along-Track Pass (
Beam filter): For each beam index $j \in [0, \text{SE_NO_MAX}-1]$, evaluates $d_\perp$ between consecutive pingsbox[j][i]andbox[j][i+1]across the remaining unflagged soundings, flagging pairs that exceedweekley_filter_width.
Interactive Workflow
- Click the
WGCicon (icon_window[17]) on theswathedtoolbar to open"WGC Tool"(sub_window[59..61]). - Inspect the
Beam filter(sub_window[60]) andSwath filter(sub_window[61]) plots to see which soundings fall outside the magenta threshold lines (coloredRED). - Press
winsidegraphic_window[1]to executedo_weekley_filter(), immediately rejecting the red outliers and refreshing both the mainswathedprofiles andWGC Toolplots.