equinor / segyio

Fast Python library for SEGY files.
Other
471 stars 213 forks source link

[bug] Gather for offset `::2` #499

Closed gsakkis closed 3 years ago

gsakkis commented 3 years ago

Getting the range of gathers when passing as offset a slice with start=None and step>1 is sometimes wrong:

(Pdb++) type(s)
<class 'segyio.segy.SegyFile'>
(Pdb++) s.offsets
array([1, 2, 3, 4, 5], dtype=int32)
(Pdb++) s.gather[1, 1, ::2].shape
(2, 10)
(Pdb++) (s.gather[1, 1, ::2] == s.gather[1, 1, slice(2, None, 2)]).all()
True

Here the expected result is the gathers for offsets [1, 3, 5], not [2, 4]