Skip to content

Survey QC: patches, fold maps, record completeness, amplitude QC (Phase 11); 0.2.0 - #3

Merged
xrfez merged 15 commits into
mainfrom
feature/survey-qc
Nov 12, 2026
Merged

xrfez merged 15 commits into
mainfrom
feature/survey-qc

Conversation

@xrfez

@xrfez xrfez commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Phase 11: survey QC on top of parseSEG 0.9.0's survey geometry. Data in, values out (D1, D14): parseSEG reads and writes SPS, SEG-Y and SEG-D.

What's new

  • Station-first join (parseSEG 0.9.0): traces match the survey by their source and receiver stations; the FFID is a fallback only. This is the Morgantown case: FFID 151 is XPS record 77.
  • survey/patch:
    • patch description of an X survey (a lines × channels template, or a distance box with clipped edges);
    • X generation from a template or a distance field (roll, shift or static edges; source placed by coordinates or by numbers; holes in R start new runs);
    • compareRelations for agreement with a supplied XPS.
  • qc/fold:
    • surveyGrid, an automatic bin grid: receiver azimuth, natural bin, centred on the midpoints' dominant phase, stray stations trimmed;
    • pre-plot fold maps (offset classes, azimuth sectors, offset range) from X or O relations;
    • actual fold from live traces in any order;
    • foldDifference.
  • qc/record: completeness of a field record against the XPS. The record is found by source station or FFID, with the other key checked; traces match by station or channel. It reports missing ranges, unlisted stations, duplicates and per-line counts; summarize totals many records.
  • qc/amplitude:
    • per trace: RMS and max in dB, DC, non-finite, clipped runs and spikes, with dead/constant/clipped/spiky/DC flags;
    • per record: median and MAD, weak/noisy outliers by robust z;
    • a ProcessPool form.
  • Docs: guide page docs/guide/survey-qc.md (runnable examples), API reference, README.

Morgantown (local example files, skipped in CI)

  • Join: all 3954 live traces joined by station.
  • Completeness: XPS 77, with 1127 expected, 1096 present, 31 missing and 2858 unlisted, in 0.65 ms.
  • Fold: the fold difference against XPS 77's pre-plot reproduces those counts bin by bin.
  • Pre-plot fold: the whole survey (11.2 M pairs) takes 1.58 s in release.
  • Amplitude QC: 27.5 ms on a pool of 4 for 3957 × 4001 samples.

Review

A fresh-agent review gate found 10 issues. Fixed:

  • spike-sum cancellation after huge spikes;
  • stray stations inflating the grid;
  • a NaN FFID reported as a mismatch;
  • station indices dropped from the match;
  • Inf counted as a clip;
  • argument guards.

Multi-component fold counting is documented. The parseSEG relations cost is deferred.

Version 0.2.0 (also covers Phase 10, PR #2).

🤖 Generated with Claude Code

xrfez and others added 15 commits November 11, 2026 20:35
…cceptance test

processSEG requires parseSEG#station-join while it is developed (atlas.lock pins
e1d2311; parseSEGBranch task points at it). tests/tsurveyjoin.nim checks the
Morgantown SPS set and its SEG-D shot (skipped without the example files):
record lookups by source station, all live traces joined by their stations
although the FFID is another shot's record, a header without its receiver
station filled from the source station's record, and (release builds) the
X -> O inversion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, per-record lines/stations/box, template or distance box, clipped sides); synthetic survey generator for tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll/shift/static, by coordinates or numbers, R holes, short lines); receiverLayout takes interval, line spacing and short-line threshold

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, max offset, centre distances, shift), alone or with a template; compareRelations per-record agreement

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r midpoint (receiver azimuth, natural bin by default; overrides)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…muth sectors, offset range) from X or O relations; Binning.binAt shared with binOf

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, any order; midpoint from keys or coordinates; header binnings), foldDifference, clear

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e station or FFID with the other key checked; traces by station or channel; missing ranges, unlisted, duplicates, per line); summarize

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ite, clipped runs, spikes against neighbours, dead/constant/DC flags; window) and per record (median/MAD of RMS dB, robust z, weak/noisy); pool form

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trimmed circular mean per station set, Rayleigh test); centre = false keeps the corner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation, binning and fold maps, completeness, amplitude QC), API reference, README; Morgantown example test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m leaves; surveyGrid trims stray stations (quartile fences) and keeps high-edge slack; NaN FFID is no record mismatch; stations keyed with their index; Inf is not a clip, clipRun >= 2; argument guards (template size, caller layout, record workspace, FFID magnitude, Inf coordinates); multi-component fold documented

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…QC (Phase 11)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xrfez
xrfez merged commit 113100e into main Nov 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant