Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve gather when offsets are negative #422

Open
James-Beckwith opened this issue Nov 8, 2019 · 2 comments
Open

Cannot retrieve gather when offsets are negative #422

James-Beckwith opened this issue Nov 8, 2019 · 2 comments
Labels

Comments

@James-Beckwith
Copy link

When the SEGY file is pre-stack data and contains negative values for the offset and specific lines/crosslines are requested then the code (gather.py, line 111) attempts to use these negative offsets to retrieve the indices to extract. This doesn't work as you can't have negative lengths:

segy.gather[3,:,:]
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\james\Miniconda3\envs\tf\lib\site-packages\segyio\gather.py", line 111, in getitem
range(*offs.indices(self.offsets[-1]+1))))
ValueError: length should not be negative
segy.offsets
array([-3237, -3212, -3187, -3162, -3137, -3112, -3087, -3062, -3037,
-3012, -2987, -2962, -2937, -2912, -2887, -2862, -2837, -2812,
-2787, -2762, -2737, -2712, -2687, -2662, -2637, -2612, -2587,
-2562, -2537, -2512, -2487, -2462, -2437, -2412, -2387, -2362,
-2337, -2312, -2287, -2262, -2237, -2212, -2187, -2162, -2137,
-2112, -2087, -2062, -2037, -2012, -1987, -1962, -1937, -1912,
-1887, -1862, -1837, -1812, -1787, -1762, -1737, -1712, -1687,
-1662, -1637, -1612, -1587, -1562, -1537, -1512, -1487, -1462,
-1437, -1412, -1387, -1362, -1337, -1312, -1287, -1262, -1237,
-1212, -1187, -1162, -1137, -1112, -1087, -1062, -1037, -1012,
-987, -962, -937, -912, -887, -862, -837, -812, -787,
-762, -737, -712, -687, -662, -637, -612, -587, -562,
-537, -512, -487, -462, -437, -412, -387, -362, -337,
-312, -287, -262], dtype=int32)

@jokva
Copy link

jokva commented Nov 8, 2019

You're right! We'll get a test case up and running and fix this.

@jokva jokva added the bug label Nov 8, 2019
@James-Beckwith
Copy link
Author

@jokva FYI, I was using the Mobil Viking graben open source data set: https://wiki.seg.org/wiki/Mobil_AVO_viking_graben_line_12 when I encountered this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants