Thursday, September 22, 2011

The SEG-Y Structure, Part 1

Okay.  I've been analysing 2D SEG-Y files all day today - on the binary level.  There may be a more in-depth analysis of it - but here's my shot.

SEG-Y Structure
We all know SEG-Y files are structured as
File Header
3200 byte EBCDIC/ASCII header
400 byte binary header
Trace Info
240 byte trace header
Sample Info
.....
wash, rinse, repeat with the trace header info - sample info

DWord/Word
After looking over the binary header & header info, I know we have the 2 byte integer type and the 4 byte integer types.  There seems to be more to it than that if you want to be able to translate things to the normal/rational world.

Here's my first example:
If you look at things on the binary level of this file you'll see:
Now, You have the -1000 number represented as FC18.  Remember it's a 16 bit WORD.  After you bring it into the real world it'll become a -1000.

Hex DWORD:  FFFFFC18 = -1000
Hex WORD:  FC10 = -1000

Look at byte location 73-76 and you're going to expect to find -293373438.  Okay, since it's a DWORD Int we're looking for:

Hex DWORD:  EE837A02 = and suddenly you get -293373438.  Whala!

If you worked for the SEG-Y subcommitee or commitee you probably already understand this.  I just figured it out in my lowly-mentality-self.

No comments:

Post a Comment