00001 /*************************************************************************** 00002 ** 00003 ** This file is part of GeopsyCore. 00004 ** 00005 ** This library is free software; you can redistribute it and/or 00006 ** modify it under the terms of the GNU Lesser General Public 00007 ** License as published by the Free Software Foundation; either 00008 ** version 2.1 of the License, or (at your option) any later version. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00013 ** License for more details. 00014 ** 00015 ** You should have received a copy of the GNU Lesser General Public 00016 ** License along with this library; if not, write to the Free Software 00017 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 ** 00019 ** See http://www.geopsy.org for more information. 00020 ** 00021 ** Created: 2011-05-24 00022 ** Authors: 00023 ** Marc Wathelet (ISTerre, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef SEGYHEADER_H 00028 #define SEGYHEADER_H 00029 00030 #include <QtCore> 00031 00032 #include "GeopsyCoreDLLExport.h" 00033 00034 namespace GeopsyCore { 00035 00036 #pragma pack(1) /* set alignment to 1 byte boundary */ 00037 00038 class GEOPSYCORE_EXPORT SEGYHeader 00039 { 00040 public: 00041 SEGYHeader(); 00042 00043 bool read(QDataStream& s); 00044 bool write(QDataStream& s); 00045 private: 00046 union { 00047 struct { 00048 char raw0[3200]; 00049 qint32 raw1[3]; 00050 qint16 raw2[24]; 00051 char raw3[240]; 00052 qint16 raw4[3]; 00053 char raw5[94]; 00054 } raw; 00055 struct { 00056 char textualFileHeader[3200]; // Index in SEGY specification (Fortran index) 00057 qint32 jobIdentification; // 3201-3204 00058 qint32 lineNumber; // 3205-3208 00059 qint32 reelNumber; // 3209-3212 00060 qint16 numberOfDataTracesPerEnsemble; // 3213-3214 00061 qint16 numberOfAuxiliaryTracesPerEnsemble; // 3215-3216 00062 qint16 sampleInterval; // 3217-3218 (in microseconds) 00063 qint16 originalSampleInterval; // 3219-3220 (in microseconds) 00064 qint16 numberOfSamplesPerTrace; // 3221-3222 00065 qint16 originalNumberOfSamplesPerTrace; // 3223-3224 00066 qint16 dataSampleFormat; // 3225-3226 (1 to 8) 00067 qint16 ensembleFold; // 3227-3228 00068 qint16 traceSorting; // 3229-3230 00069 qint16 verticalSum; // 3231-3232 00070 qint16 startSweepFrequency; // 3233-3234 00071 qint16 endSweepFrequency; // 3235-3236 00072 qint16 sweepLength; // 3237-3238 (in ms) 00073 qint16 sweepType; // 3239-3240 00074 qint16 sweepTraceChannelNumber; // 3241-3242 00075 qint16 startSweepTraceTaperLength; // 3243-3244 00076 qint16 endSweepTraceTaperLength; // 3245-3246 00077 qint16 taperType; // 3247-3248 00078 qint16 correlatedDataTraces; // 3249-3250 00079 qint16 binaryGainRecovered; // 3251-3252 00080 qint16 amplitudeRecoveryMethod; // 3253-3254 00081 qint16 measurementSystem; // 3255-3256 00082 qint16 impulseSignalPolarity; // 3257-3258 00083 qint16 vibratoryPolarity; // 3259-3260 00084 char unassigned0[240]; // 3261-3500 00085 qint16 segYRevisionNumber; // 3501-3502 00086 qint16 fixLengthTraceFlag; // 3503-3504 00087 qint16 numberOfExtendedTextualHeaders; // 3505-3506 00088 char unassigned1[94]; // 3507-3600 00089 } field; 00090 }; 00091 }; 00092 00093 #pragma pack() // restore original alignment 00094 00095 } // namespace GeopsyCore 00096 00097 #endif // SEGYHEADER_H