Repository navigation
Fix silent wrong-data bugs: read_segy on pre-stack files, plan cache key, plan stage geometry - #10
Merged
Merged
Conversation
segyio's f.trace[:] reuses two buffers, so the fallback np.stack gave every row the last or second-to-last trace on any unstructured file (pre-stack gathers, write_segy output), with no error. Unstructured files now read f.trace.raw[:]; structured ones still go through cube, without the blanket except. Round-trip tests; the Viking line now matches SEGYReader on all 120120 traces.
- The cache key named the vp source only by path/dataset/constant, so a linear_gradient change (also shape, smoothing, grid.dh, lift, non-vp models, an .npy rewritten in place) hit the old entry and the run started from the cached model. Key on every init model's spec plus file size/mtime, grid.dh and the lift. - Stages re-snapped the 12.5 m-rounded positions: at 25 m Viking's 1001 shots merged into 503 cells, 168 moved at 75/15 m. materialize now also returns (and caches) the un-rounded positions and fwi builds the stage geometry from them, as the SEG-Y route does.
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.
Three bugs that let a run finish without an error while reading the wrong data or starting from the wrong model/geometry.
read_segyon pre-stack files: segyio'sf.trace[:]reuses two buffers, so on any unstructured file (pre-stack gathers,write_segyoutput) every row came back as a copy of the last or second-to-last trace. Unstructured files now readf.trace.raw[:]; structured files still usecube, without the blanketexcept.obs.planmaterialize cache key: it named the vp source only by path/dataset/constant, so changinglinear_gradient(or shape, smoothing,grid.dh, the source lift, a non-vp model, an.npyrewritten in place) hit the old cache entry and the run started from the cached model. The key now covers every init model's spec, file size/mtime,grid.dhand the lift. Existing.materialize_cachedirectories are invalidated once.from_planresults change accordingly and now match the SEG-Y route.Tested: 7 new tests (the 6 bug tests fail on main); full
tests/on a V100 and on CPU with no other change; on the Viking line,read_segymatchesSEGYReaderon all 120,120 traces and the stage source cells match the SEG-Y route at every grid from 75 m to 12.5 m.🤖 Generated with Claude Code