BUG: Fix stretch in converted seismic when MSL is given and avoid flo…#448
Open
anbec12 wants to merge 1 commit into
Open
BUG: Fix stretch in converted seismic when MSL is given and avoid flo…#448anbec12 wants to merge 1 commit into
anbec12 wants to merge 1 commit into
Conversation
…ating-point errors
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.
…ating-point errors
Resolves #445 and #446
Added several fixes that were related. It became therefore a relatively large pull-request.
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.
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.
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
--cov=src/ --cov-report term-missing)