agilescientific / jeepr

GPR utilities
Apache License 2.0
8 stars 8 forks source link

Test SEGY file support #3

Open EvanBianco opened 5 years ago

EvanBianco commented 5 years ago

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

kwinkunks commented 5 years ago

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

EvanBianco commented 5 years ago

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 commented 5 years ago

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.')