equinor / segyio

Fast Python library for SEGY files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Invalid dimensions error while trying to open SEGY file

warda-rezig opened this issue · comments

I am trying to follow this tutorial https://www.youtube.com/watch?v=grGa-B4gV9c about "Dislplaying Seismic Data in Jupyter Notebook using SEGYIO Library" and while opening the SEGY file I got this error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-1d5c8a438b58> in <module>
----> 1 segyio.open(filename)

/opt/conda/lib/python3.9/site-packages/segyio/open.py in open(filename, mode, iline, xline, strict, ignore_geometry, endian)
    185         return f
    186 
--> 187     return infer_geometry(f, metrics, iline, xline, strict)

/opt/conda/lib/python3.9/site-packages/segyio/open.py in infer_geometry(f, metrics, iline, xline, strict)
     17 
     18         f.xfd.indices(metrics, ilines, xlines, offsets)
---> 19         f.interpret(ilines, xlines, offsets, f._sorting)
     20 
     21     except:

/opt/conda/lib/python3.9/site-packages/segyio/segy.py in interpret(self, ilines, xlines, offsets, sorting)
    942                                                                            offsets.size,
    943                                                                            self.tracecount)
--> 944             raise ValueError(error)
    945 
    946         from . import _segyio

ValueError: Invalid dimensions, ilines (631) * xlines (951) * offsets (1) should match the number of traces (600515)
​```

Hi,

Segyio requires a regular cube in order to infer geometry. You can tell segyio.open to ignore any geometry. Have a look here:

https://segyio.readthedocs.io/en/latest/segyio.html#segyio.open
https://github.com/equinor/segyio#runtimeerror-unable-to-find-sorting

Closing due to inactivity, feel tree to reopen