Trace/Sample Math

You can calculate the number of traces in a file or the number of samples per trace by doing a few calculations based on the SEG-Y file size. Windows Explorer rounds file size off so you will need to get a more precise file size for calculations by right-clicking on the filename and selecting Properties.

Next you need to know the file trace data type. Each byte is made up of eight bits. Therefore, each 8-bit sample takes one byte of file. Each 16-bit sample takes two bytes and floating point IBM or IEEE each take four bytes.

Subtract the bytes used for the ASCII header (3200 bytes) and Binary Header (400 bytes) from the size of the file. The rest of the bytes are used for trace headers and data samples. We know that each trace in the file has a 240-byte trace header.

Therefore, if we know the number of samples we can find the number of traces and vice versa. Even if you only have an estimate of the number of traces you can probably figure out the number of samples by trial and error.

Bytes in file - 3600 = data portion of file

So,

Data portion of file - (Number of traces * 240) = Trace data bytes in file

Trace data bytes in file/bytes per sample = Data samples in file

Data samples in file/Number of traces = Samples per trace

Or,

240 + (Bytes per sample * Samples per trace) = Trace size

Data portion of file/Trace size = Number of traces in file