public void ReadBinaryHeader() { SeismicLog.WriteLog(DateTime.Now + "Reading Binary Header."); int sampleInterval = 0; //sample interval in microseconds int dataSampleFormat = 0; if (countNoOfBytes < 3600) { inputSegyFileStream.Seek(16, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (16); byteOutputOfReader = segyReader.ReadByte(); sampleInterval = sampleInterval + (byteOutputOfReader * 256); countNoOfBytes++; byteOutputOfReader = segyReader.ReadByte(); sampleInterval = sampleInterval + (byteOutputOfReader); countNoOfBytes++; inputSegyFileStream.Seek(2, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (2); byteOutputOfReader = segyReader.ReadByte(); noOfsamplesperDataTrace = noOfsamplesperDataTrace + (byteOutputOfReader * 256); countNoOfBytes++; byteOutputOfReader = segyReader.ReadByte(); noOfsamplesperDataTrace = noOfsamplesperDataTrace + byteOutputOfReader; countNoOfBytes++; inputSegyFileStream.Seek(2, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (2); byteOutputOfReader = segyReader.ReadByte(); dataSampleFormat = dataSampleFormat + (byteOutputOfReader * 256); countNoOfBytes++; byteOutputOfReader = segyReader.ReadByte(); dataSampleFormat = dataSampleFormat + byteOutputOfReader; countNoOfBytes++; if (dataSampleFormat == 1 | dataSampleFormat == 2 | dataSampleFormat == 4 | dataSampleFormat == 5) { multiplierTrace = 4; } else if (dataSampleFormat == 3) { multiplierTrace = 2; } else if (dataSampleFormat == 8) { multiplierTrace = 1; } inputSegyFileStream.Seek(278, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (278); byteOutputOfReader = segyReader.ReadByte(); noOfExtendedTexHeaders = noOfExtendedTexHeaders + (byteOutputOfReader * 256); countNoOfBytes++; byteOutputOfReader = segyReader.ReadByte(); noOfExtendedTexHeaders = noOfExtendedTexHeaders + byteOutputOfReader; countNoOfBytes--; inputSegyFileStream.Seek(94, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (94); SeismicLog.WriteLog(DateTime.Now + "End of Binary Header."); //This is a loop where we are skipping Extended Textual Headers if present in SEGY if (noOfExtendedTexHeaders > 0) { for (int NoOfExtTextHeader = 0; NoOfExtTextHeader < noOfExtendedTexHeaders; NoOfExtTextHeader++) { inputSegyFileStream.Seek(3200, SeekOrigin.Current); countNoOfBytes = countNoOfBytes + (3200); } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)