slimgroup / SegyIO.jl

SegyIO.jl provides methods to read, write, and scan SEGY datasets.
MIT License
16 stars 5 forks source link

Little endian segy #18

Open kerim371 opened 1 year ago

kerim371 commented 1 year ago

Hi,

It seems there is no automatic check if endianess. The package always supposes that endian is big. This makes impossible to read/scan little endian segy.

kerim371 commented 1 year ago

If so then I propose to add function: getSEGYEndian(file) that checks dataFormatCode then switches bytes and becomes dataFormatCodeSE and then we can check either dataFormatCode should be in range [1,8] or dataFormatCodeSE in the same range (these are exclusive: only one of those variable can be in range [1,8] at the same time). Then check native machine endian using Julia API (there must be something) and make a decision wich endian has the SEGY. And use this endian when reading/scanning SEGY.

mloubout commented 1 year ago

That could be good indeed

kerim371 commented 1 year ago

I think I could try.