Repository navigation
parseSEG 0.8.0: keysAt, failed-row reads, chunk window origin, SEG-Y from TraceKeys - #1
Merged
Merged
Conversation
`traceKeys(rows, row)` raises ValueError when the view has no keys, so a
`{.raises: [].}` kernel or a prefetch ChunkTransform cannot call it.
`keysAt` is for callers that checked `hasKeys` once: no keys is an
AssertionDefect with bound checks on. Tests in ttracerows (also from a
raises: [] proc and in a transform).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- readTracesInto(f, traces[, samples], dst, failedRows, row = 0) fills a caller's seq[int] with the rows that failed to decode (cleared, capacity kept, no log), as PrefetchChunk.failedRows does; the other forms report failures only through a DiagLog, which allocates per failure; - PrefetchChunk.firstSample: the prefetcher's window origin, so a consumer can place a windowed chunk's columns on the time axis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- openSeismicWriter(path, SegyOutputOptions): a SEG-Y file with no input to model (revision, byte order, format, textual header lines, trace sorting, measurement system); validated at open, the first trace sets the binary interval and sample count; - writeTrace(w, keys, samples, overrides): trace headers from TraceKeys in the standard layout (Rev 2: also the f64 values of Trace Header Extension 1), so a stack of SEG-D or SEG-2 input can be written as SEG-Y; openSeismic reads the same keys back; - the encoders shared with the converter moved to private/segyencode. Tests in twritekeys; docs/api.md and the processing guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ields to it A trace read live (code 1) and then killed in the keys was written back live; the stored code is now kept only when its status agrees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for whole delays, no component as trace code, Rev 0/1 interval limit - writeTrace(w, src, trace, ...) on a writer opened from SegyOutputOptions is refused: its binary header (interval, Ext1 count) is made for traces from keys, and kept a placeholder interval of 1000 us; - a delay within 1 ns of a whole ms gets time scalar 1, so readers that ignore bytes 215-216 read 4, not 4000; - the trace identification code no longer comes from `component` (a group index or sensor type outside SEG-Y; a SEG-Y code is in traceCode); - Rev 0/1 output refuses intervals over 65535 us (was clamped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New since 0.7.0: TraceRows.keysAt; readTracesInto failed-row lists; PrefetchChunk.firstSample; SEG-Y written from TraceKeys (openSeismicWriter(path, SegyOutputOptions), writeTrace(w, keys, samples, overrides)). 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.
What a processing library built on parseSEG (processSEG) needed from it, developed and tested against that library before being offered here.
New
TraceRows.keysAt(row): the non-raising form oftraceKeys(rows, row), for callers that checkedhasKeysonce, so{.raises: [].}kernels and prefetchtransformhooks can read keys.readTracesInto(f, traces[, samples], dst, failedRows, row = 0): fills a caller'sseq[int]with the rows that failed to decode (cleared, capacity kept, no log), asPrefetchChunk.failedRowsdoes.PrefetchChunk.firstSample: the prefetcher's window origin, so a windowed chunk's columns can be placed on the time axis.TraceKeys:openSeismicWriter(path, SegyOutputOptions(...))opens a SEG-Y file with no input to model;writeTrace(w, keys, samples, overrides)builds the trace headers fromTraceKeysin the standard layout (Rev 2: also the f64 values of Trace Header Extension 1). A stack of SEG-D or SEG-2 input can now be written as SEG-Y, andopenSeismicreads the same keys back. The stored trace code is kept only when its status agrees with the keys' (a trace killed in the keys is written dead).Hardened after review: template traces are refused on a writer opened from
SegyOutputOptions; a delay within 1 ns of a whole ms keeps time scalar 1;componentis not written as a trace code; Rev 0/1 output refuses intervals over 65535 µs.Compatibility
No breaking changes: everything above is additive. The SEG-Y encoders shared with the converter moved to
private/segyencode(internal). Version bumped to 0.8.0.Tests
New
tests/twritekeys.nim(SEG-D and SEG-2 demos to Rev 2.1, Rev 1, little-endian f64, a 70 000-sample stack line, time scalars, refusals), additions tottracerowsandtprefetchrows; the whole suite passes (nim test), and processSEG's suite passes against this branch (debug, release, danger, ASan).docs/api.mdand the processing guide are updated.🤖 Generated with Claude Code