Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Test SEGY file support #3

Open
EvanBianco opened this issue Dec 13, 2018 · 3 comments
Open

Test SEGY file support #3

EvanBianco opened this issue Dec 13, 2018 · 3 comments
Assignees
Labels

Comments

@EvanBianco
Copy link

Test some SEGY files from USRadar and make sure the i/o works

@EvanBianco EvanBianco added the bug label Dec 13, 2018
@EvanBianco EvanBianco self-assigned this Dec 13, 2018
@kwinkunks
Copy link
Member

I thought we got SEG-2 files (their RAD, RA1, RA2 files) from US Radar's software, not SEG-Y?

@EvanBianco
Copy link
Author

We did get some files that are named SEG-Y. But we also have RA files for these, so In this case, the SEGY is redundant. I can't confirm if it is SEG-2 or SEG-Y format.

@kwinkunks
Copy link
Member

You could try:

from struct import unpack
with open(fname, 'rb') as f:
    file_descriptor_block = f.read(32)
    first_byte, = unpack(b'B', file_descriptor_block[0:1])
    if (first_byte == 0x55) or (first_byte == 0x3a):
        print('This is consistent with being a SEG2 file.')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants