GeopsyCore/SACHeader.h
Go to the documentation of this file.
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 : 2009-08-26
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef SACHEADER_H
00029 #define SACHEADER_H
00030 
00031 #include "SignalFile.h"
00032 #include "GeopsyCoreDLLExport.h"
00033 
00034 namespace GeopsyCore {
00035 
00036 #pragma pack(1)     /* set alignment to 1 byte boundary */
00037 
00038 class GEOPSYCORE_EXPORT SACHeader
00039 {
00040 public:
00041   SACHeader();
00042 
00043   static SignalFileFormat determineByteOrder(QString fileName);
00044 
00045   void read(QDataStream& s);
00046   bool write(QDataStream& s);
00047 
00048   QDateTime startTime() const;
00049   union {
00050     float raw [70];
00051     struct {
00052       float DELTA;      // 0
00053       float DEPMIN;
00054       float DEPMAX;
00055       float SCALE;
00056       float ODELTA;
00057       float B;          // 5
00058       float E;
00059       float O;
00060       float A;
00061       float INTERNAL0;
00062       float T[10];      // 10
00063       float F;          // 20
00064       float RESP0;
00065       float RESP1;
00066       float RESP2;
00067       float RESP3;
00068       float RESP4;      // 25
00069       float RESP5;
00070       float RESP6;
00071       float RESP7;
00072       float RESP8;
00073       float RESP9;      // 30
00074       float STLA;
00075       float STLO;
00076       float STEL;
00077       float STDP;
00078       float EVLA;       // 35
00079       float EVLO;
00080       float EVEL;
00081       float EVDP;
00082       float MAG;
00083       float USER0;      // 40
00084       float USER1;
00085       float USER2;
00086       float USER3;
00087       float USER4;
00088       float USER5;      // 45
00089       float USER6;
00090       float USER7;
00091       float USER8;
00092       float USER9;
00093       float DIST;       // 50
00094       float AZ;
00095       float BAZ;
00096       float GCARC;
00097       float INTERNAL1;
00098       float INTERNAL2;  // 55
00099       float DEPMEN;
00100       float CMPAZ;
00101       float CMPINC;
00102       float XMINIMUM;
00103       float XMAXIMUM;   // 60
00104       float YMINIMUM;
00105       float YMAXIMUM;
00106       float UNUSED0;
00107       float UNUSED1;
00108       float UNUSED2;    // 65
00109       float UNUSED3;
00110       float UNUSED4;
00111       float UNUSED5;
00112       float UNUSED6;
00113     } field;
00114   } floats;
00115   union {
00116     qint32 raw [35];
00117     struct {
00118       qint32 NZYEAR;          // 70
00119       qint32 NZJDAY;
00120       qint32 NZHOUR;
00121       qint32 NZMIN;
00122       qint32 NZSEC;
00123       qint32 NZMSEC;          // 75
00124       qint32 NVHDR;           //      Header version number [required]
00125       qint32 NORID;
00126       qint32 NEVID;
00127       qint32 NPTS;
00128       qint32 INTERNAL;       // 80
00129       qint32 NWFID;
00130       qint32 NXSIZE;
00131       qint32 NYSIZE;
00132       qint32 UNUSED0;
00133       qint32 IFTYPE;         // 85
00134       qint32 IDEP;
00135       qint32 IZTYPE;
00136       qint32 UNUSED1;
00137       qint32 IINST;
00138       qint32 ISTREG;         // 90
00139       qint32 IEVREG;
00140       qint32 IEVTYP;
00141       qint32 IQUAL;
00142       qint32 ISYNTH;
00143       qint32 IMAGTYP;        // 95
00144       qint32 IMAGSRC;
00145       qint32 UNUSED2;
00146       qint32 UNUSED3;
00147       qint32 UNUSED4;
00148       qint32 UNUSED5;        // 100
00149       qint32 UNUSED6;
00150       qint32 UNUSED7;
00151       qint32 UNUSED8;
00152       qint32 UNUSED9;
00153     } field;
00154   } ints;
00155   union {
00156     quint32 raw [5];
00157     struct {
00158       quint32 LEVEN;          // 105
00159       quint32 LPSPOL;
00160       quint32 LOVROK;
00161       quint32 LCALDA;
00162       quint32 UNUSED;
00163     } field;
00164   } bools;
00165   union {
00166     char raw [192];
00167     struct {
00168       char KSTNM [8];     // 110
00169       char KEVNM [16];
00170       char KHOLE [8];     // 116
00171       char KO [8];
00172       char KA [8];
00173       char KT0 [8];       // 122
00174       char KT1 [8];
00175       char KT2 [8];
00176       char KT3 [8];       // 128
00177       char KT4 [8];
00178       char KT5 [8];
00179       char KT6 [8];       // 134
00180       char KT7 [8];
00181       char KT8 [8];
00182       char KT9 [8];       // 140
00183       char KF [8];
00184       char KUSER0 [8];
00185       char KUSER1 [8];    // 146
00186       char KUSER2 [8];
00187       char KCMPNM [8];
00188       char KNETWK [8];    // 152
00189       char KDATRD [8];
00190       char KINST [8];
00191     } field;
00192   } chars;
00193 };
00194 
00195 #pragma pack()   // restore original alignment
00196 
00197 } // namespace GeopsyCore
00198 
00199 #endif // SACHEADER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines