Skip to content

BUG: Fix stretch in converted seismic when MSL is given and avoid flo…#448

Open
anbec12 wants to merge 1 commit into
equinor:mainfrom
anbec12:fix_msl_input
Open

BUG: Fix stretch in converted seismic when MSL is given and avoid flo…#448
anbec12 wants to merge 1 commit into
equinor:mainfrom
anbec12:fix_msl_input

Conversation

@anbec12

@anbec12 anbec12 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

…ating-point errors

Resolves #445 and #446

Added several fixes that were related. It became therefore a relatively large pull-request.

  1. In the tests, the issue with the commented out line with parameters [(None, None, None), (1.1, 0, 82.5)] for test_proposing_zinc_etc_depthconvert was resolved by adding correct support for None as input in dconvert.py _derive_result_cube_design and by dealing with potential floating-point errors when calculating the nlay parameter.

  2. There was a substantial methodological issue with the way the velocity or slowness cubes were generated in dconvert.py _extend_incube_create_speed_cube_average. Originally, the average velocity or slowness maps were interpolated and extrapolated with np.interp to get the upsampled 'speed' function corresponding to the trace sampling. However, this could lead to stretching of the converted seismic in the overburden and wrong velocities below the last horizon. I have now changed the interpolation to linear interpolation of the time-depth function adding linear right-slope extrapolation which resolves the issues. This required also an update of _resample_surfaces_to_cube, a helper function which is only called by _extend_incube_create_speed_cube_average, returning time and depth surfaces instead of time/depth and velocity/slowness surfaces, depending if converting time->depth or vice versa.

  3. When providing MSL horizons for time and depth (MSL: everywhere z = 0), one got different results compared to the case they were not provided. The results should have been identical (now included tests for this). The result with the MSL given showed stretched seismic in the overburden. This issue was solved by case differentiation if MSL was input in dconvert.py _velo_maps_average and likewise _slow_maps_average.

The features were related because they failed on the test_depth_cube_values_with_msl and test_depth_cube_values, depending on the input. I have also added a small sine-wave cube for testing, because I think the comparison before-after is more valid when you have data throughout the cube. The cube will also be used in a future PR with respect to amplitude preservation and trace interpolation.

Checklist

  • Tests added (if not, comment why)
  • Test coverage equal or up from main (run pytest with --cov=src/ --cov-report term-missing)
  • If not squash merging, every commit passes tests
  • Appropriate commit prefix and precise commit message used
  • All debug prints and unnecessary comments removed
  • Docstrings are correct and updated
  • Documentation is updated, if necessary
  • Latest main rebased/merged into branch
  • Added comments on this PR where appropriate to help reviewers
  • Moved issue status on project board
  • Checked the boxes in this checklist ✅

@anbec12 anbec12 marked this pull request as ready for review June 15, 2026 20:51
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.

Seismic gets stretched above first subsurface horizon when using MSL as input

1 participant