Brief description of class still missing. More...
#include <SACHeader.h>
Public Member Functions | |
void | read (QDataStream &s) |
SACHeader () | |
QDateTime | startTime () const |
bool | write (QDataStream &s) |
Static Public Member Functions | |
static SignalFileFormat | determineByteOrder (QString fileName) |
Public Attributes | |
union { | |
struct { | |
quint32 LCALDA | |
quint32 LEVEN | |
quint32 LOVROK | |
quint32 LPSPOL | |
quint32 UNUSED | |
} field | |
quint32 raw [5] | |
} | bools |
union { | |
struct { | |
char KA [8] | |
char KCMPNM [8] | |
char KDATRD [8] | |
char KEVNM [16] | |
char KF [8] | |
char KHOLE [8] | |
char KINST [8] | |
char KNETWK [8] | |
char KO [8] | |
char KSTNM [8] | |
char KT0 [8] | |
char KT1 [8] | |
char KT2 [8] | |
char KT3 [8] | |
char KT4 [8] | |
char KT5 [8] | |
char KT6 [8] | |
char KT7 [8] | |
char KT8 [8] | |
char KT9 [8] | |
char KUSER0 [8] | |
char KUSER1 [8] | |
char KUSER2 [8] | |
} field | |
char raw [192] | |
} | chars |
union { | |
struct { | |
float A | |
float AZ | |
float B | |
float BAZ | |
float CMPAZ | |
float CMPINC | |
float DELTA | |
float DEPMAX | |
float DEPMEN | |
float DEPMIN | |
float DIST | |
float E | |
float EVDP | |
float EVEL | |
float EVLA | |
float EVLO | |
float F | |
float GCARC | |
float INTERNAL0 | |
float INTERNAL1 | |
float INTERNAL2 | |
float MAG | |
float O | |
float ODELTA | |
float RESP0 | |
float RESP1 | |
float RESP2 | |
float RESP3 | |
float RESP4 | |
float RESP5 | |
float RESP6 | |
float RESP7 | |
float RESP8 | |
float RESP9 | |
float SCALE | |
float STDP | |
float STEL | |
float STLA | |
float STLO | |
float T [10] | |
float UNUSED0 | |
float UNUSED1 | |
float UNUSED2 | |
float UNUSED3 | |
float UNUSED4 | |
float UNUSED5 | |
float UNUSED6 | |
float USER0 | |
float USER1 | |
float USER2 | |
float USER3 | |
float USER4 | |
float USER5 | |
float USER6 | |
float USER7 | |
float USER8 | |
float USER9 | |
float XMAXIMUM | |
float XMINIMUM | |
float YMAXIMUM | |
float YMINIMUM | |
} field | |
float raw [70] | |
} | floats |
union { | |
struct { | |
qint32 IDEP | |
qint32 IEVREG | |
qint32 IEVTYP | |
qint32 IFTYPE | |
qint32 IINST | |
qint32 IMAGSRC | |
qint32 IMAGTYP | |
qint32 INTERNAL | |
qint32 IQUAL | |
qint32 ISTREG | |
qint32 ISYNTH | |
qint32 IZTYPE | |
qint32 NEVID | |
qint32 NORID | |
qint32 NPTS | |
qint32 NVHDR | |
qint32 NWFID | |
qint32 NXSIZE | |
qint32 NYSIZE | |
qint32 NZHOUR | |
qint32 NZJDAY | |
qint32 NZMIN | |
qint32 NZMSEC | |
qint32 NZSEC | |
qint32 NZYEAR | |
qint32 UNUSED0 | |
qint32 UNUSED1 | |
qint32 UNUSED2 | |
qint32 UNUSED3 | |
qint32 UNUSED4 | |
qint32 UNUSED5 | |
qint32 UNUSED6 | |
qint32 UNUSED7 | |
qint32 UNUSED8 | |
qint32 UNUSED9 | |
} field | |
qint32 raw [35] | |
} | ints |
Brief description of class still missing.
SAC binary format is very simple: 632 bytes of header followed by the data. For more informations see SAC online manual at http://www.iris.edu/manuals/sac/manual.html
SignalFileFormat GeopsyCore::SACHeader::determineByteOrder | ( | QString | fileName | ) | [static] |
References GeopsyCore::SignalFileFormat::SacBigEndian, GeopsyCore::SignalFileFormat::SacLittleEndian, and GeopsyCore::SignalFileFormat::Unknown.
Referenced by GeopsyCore::SignalFileFormat::fromContent(), and GeopsyCore::SignalFileFormat::fromSuffix().
{ QFile f(fileName); if( !f.open(QIODevice::ReadOnly) ) { return SignalFileFormat::Unknown; } QDataStream s(&f); s.setByteOrder(QDataStream::LittleEndian); int version, iftype, leven; f.seek(76 * 4); s >> version; f.seek(85 * 4); s >> iftype; f.seek(105 * 4); s >> leven; if(version==6 && iftype==1 && leven) return SignalFileFormat::SacLittleEndian; f.seek(0); // reset to begin of file s.setByteOrder(QDataStream::BigEndian); f.seek(76 * 4); s >> version; f.seek(85 * 4); s >> iftype; f.seek(105 * 4); s >> leven; if(version==6 && iftype==1 && leven) return SignalFileFormat::SacBigEndian; return SignalFileFormat::Unknown; }
void GeopsyCore::SACHeader::read | ( | QDataStream & | s | ) |
QDateTime GeopsyCore::SACHeader::startTime | ( | ) | const |
bool GeopsyCore::SACHeader::write | ( | QDataStream & | s | ) |
float GeopsyCore::SACHeader::A |
float GeopsyCore::SACHeader::B |
union { ... } GeopsyCore::SACHeader::bools |
Referenced by read(), SACHeader(), write(), and GeopsyCore::Signal::writeSac().
union { ... } GeopsyCore::SACHeader::chars |
Referenced by read(), SACHeader(), write(), and GeopsyCore::Signal::writeSac().
float GeopsyCore::SACHeader::E |
float GeopsyCore::SACHeader::F |
struct { ... } GeopsyCore::SACHeader::field |
Referenced by GeopsyCore::Signal::writeSac().
struct { ... } GeopsyCore::SACHeader::field |
struct { ... } GeopsyCore::SACHeader::field |
struct { ... } GeopsyCore::SACHeader::field |
union { ... } GeopsyCore::SACHeader::floats |
Referenced by read(), SACHeader(), write(), and GeopsyCore::Signal::writeSac().
qint32 GeopsyCore::SACHeader::IDEP |
qint32 GeopsyCore::SACHeader::IINST |
union { ... } GeopsyCore::SACHeader::ints |
Referenced by read(), SACHeader(), startTime(), write(), and GeopsyCore::Signal::writeSac().
qint32 GeopsyCore::SACHeader::IQUAL |
char GeopsyCore::SACHeader::KA[8] |
char GeopsyCore::SACHeader::KCMPNM[8] |
char GeopsyCore::SACHeader::KDATRD[8] |
char GeopsyCore::SACHeader::KEVNM[16] |
char GeopsyCore::SACHeader::KF[8] |
char GeopsyCore::SACHeader::KHOLE[8] |
char GeopsyCore::SACHeader::KINST[8] |
char GeopsyCore::SACHeader::KNETWK[8] |
char GeopsyCore::SACHeader::KO[8] |
char GeopsyCore::SACHeader::KSTNM[8] |
char GeopsyCore::SACHeader::KT0[8] |
char GeopsyCore::SACHeader::KT1[8] |
char GeopsyCore::SACHeader::KT2[8] |
char GeopsyCore::SACHeader::KT3[8] |
char GeopsyCore::SACHeader::KT4[8] |
char GeopsyCore::SACHeader::KT5[8] |
char GeopsyCore::SACHeader::KT6[8] |
char GeopsyCore::SACHeader::KT7[8] |
char GeopsyCore::SACHeader::KT8[8] |
char GeopsyCore::SACHeader::KT9[8] |
char GeopsyCore::SACHeader::KUSER0[8] |
char GeopsyCore::SACHeader::KUSER1[8] |
char GeopsyCore::SACHeader::KUSER2[8] |
quint32 GeopsyCore::SACHeader::LCALDA |
quint32 GeopsyCore::SACHeader::LEVEN |
quint32 GeopsyCore::SACHeader::LOVROK |
quint32 GeopsyCore::SACHeader::LPSPOL |
qint32 GeopsyCore::SACHeader::NEVID |
qint32 GeopsyCore::SACHeader::NORID |
qint32 GeopsyCore::SACHeader::NPTS |
qint32 GeopsyCore::SACHeader::NVHDR |
qint32 GeopsyCore::SACHeader::NWFID |
qint32 GeopsyCore::SACHeader::NZMIN |
qint32 GeopsyCore::SACHeader::NZSEC |
float GeopsyCore::SACHeader::O |
float GeopsyCore::SACHeader::raw[70] |
qint32 GeopsyCore::SACHeader::raw[35] |
quint32 GeopsyCore::SACHeader::raw[5] |
char GeopsyCore::SACHeader::raw[192] |
float GeopsyCore::SACHeader::T[10] |
quint32 GeopsyCore::SACHeader::UNUSED |