[Solved] Segyio Error: Runtime Error trace count inconsistent with file size, trace lengths … #401

Article catalog

Run segyio to read segy files and report errors. Troubleshooting error cause reference

An error occurs when running segyio to read the segy file

"RuntimeError: trace count inconsistent with file size, trace lengths possibly of non-uniform"

Solution:

(1) Add: endian ='little '

with segyio.open('test.sgy','r',ignore_geometry=True,endian='little') as f:

(2) If it still fails:
check the length of the data trace. Segyio’s default trace has the same number and format of sampling points. If the length of the trace in the segy file is inconsistent, it may lead to reading errors.

Error reason

Detailed explanation of big endian and little endian
the default bytes of files read by segyio are encoded according to big endian, while your files are written according to little endian bytes


Read More: