Repository navigation
parseSEG 0.9.0: survey joins match by stations; receiver-domain (O) relations - #2
Merged
Merged
Conversation
…tions Field record numbers and channel numbers in the data often differ from the relation file's (a recorder numbers all its live channels; renumbered or reshot records), while the header stations are right. The join now matches by stations and never replaces a header station: - both stations in the header: coordinates by station only; - source station only: the receiver from the X records of that source station (the one with the trace's record number among repeats, else they must agree); - receiver station only: the source from the O gathers of that receiver, or the X relation of record and channel if its receiver is the header's; - no station: record and channel, the fallback. `overwrite` now replaces coordinates only. Auxiliary traces are left alone. `joinStations` exposes the station step; `JoinMatch` and `JoinStats` (from new `applySurvey` overloads) say how traces matched. The CLI prints them. Relations of both domains (`RelationDomain`): O records (record letter O, or X records in an `.ops` file) are the X layout with source and receiver swapped. New lookups: `records`, `relations`, `expectedChannels`, `recordsAt`, `channelOf`, `sameStation`. `receiverRelations` builds the O records of an X survey, one receiver line in memory at a time. Also fixes writeGeometry/copyWithGeometry reporting a value that rounds to the bytes already in the file (shotpoint 99.5 into an espnum holding 100) as a write the journal dropped (a fatal error): such a trace is no change. Docs (conversion guide, api.md, SPS spec notes) and tests follow; tests that relied on the old (record, channel)-first join now use headers without the station they fill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New since 0.8.0: survey joins match traces by their stations (header stations are never replaced; record and channel only for traces without stations; overwrite refreshes coordinates only); JoinMatch / JoinStats; receiver-domain O relations (.ops), receiverRelations to build them from X; relation lookups (records, relations, expectedChannels, recordsAt, channelOf). Fix: a geometry value that rounds to the bytes already in the file is no change (it was reported as a dropped journal write). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Field record numbers and channel numbers in seismic data often differ from the relation (X) file's. A recorder numbers all its live channels; reshoots and renumbered post-plots move records. Meanwhile the header stations are right. The old join keyed on (record, channel) first, and with
overwrite = trueit replaced header stations from it. On a 3D land survey this assigned every trace of a shot the stations of another shot (the file's FFID was another shot's X record). The trace numbers also matched the X channels for only 23 of 1127 traces.What changes
Station-first join. Traces are matched by their source and receiver line/point. Header stations are never replaced; the relations only fill stations a header lacks:
overwritenow refreshes coordinates, offset and midpoint only. Auxiliary traces are left alone.joinStationsexposes the station step.JoinMatchandJoinStats(newapplySurveyoverloads, printed by the CLI) say how traces matched.Receiver-domain relations. O records (
.opsfiles) are the X layout with source and receiver swapped, one gather per receiver. They are read with record letterO; X-lettered records in an.opsfile are taken as O by default.receiverRelations(g)builds them from X, one receiver line in memory at a time: 11.2 M pairs → 1.07 M O records in about 3 s.Lookups.
records,relations(iterators),expectedChannels,recordsAt(the records of a source station / gathers of a receiver),channelOf,sameStation,relationCount(g, domain).Fix.
writeGeometry/copyWithGeometryreported a value that rounds to the bytes already in the file (shotpoint 99.5 into anespnumholding 100) as a write the journal dropped, a fatal error. It is now no change, with a regression test.Behaviour changes for callers
overwrite.record.sgd's own stations through X; it now uses the file's real stations.Testing
nim testpasses, including the 44 guide examples. The sample-file tests were run with the samples available here: thetgeomwriteandtclisurvey blocks pass.segd_rev3_position_blocksneeds the INOVA sample, which was not available. It now expects 2 changed traces instead of 5, because its 3 auxiliary traces are left alone. Please run the sample suite with the INOVA file.🤖 Generated with Claude Code