equinor / segyio

Fast Python library for SEGY files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEG-Y rev2 file endianness

TheZappie opened this issue · comments

SEG-Y rev2 officially allows files to be written in both little and big endian.
As per file specification, the endianness can be inferred from bytes 3297-3300. However in Segyio, one has to explicitly pass the endianness to segyio.open.

Feature request: infer the file endianness from the SEG-Y when opening the file by default (and revert back to old behavior when nothing is found in the relevant bytes).

Currently segyio doesn't recognize the rev2 fields. That may be required to implement this.

f.bin[3297] = 16909060
File "C:\ProgramData\Miniconda3\envs\py310\lib\site-packages\segyio\field.py", line 419, in __setitem__
    self.putfield(self.buf, key, val)
KeyError: 'No such field 3297'