SeismicDataComp.h
Go to the documentation of this file.00001 #ifndef CSEISMICDATACOMP_H
00002 #define CSEISMICDATACOMP_H
00003 #include <string>
00004 #include "types.h"
00005 #include "TimeSeriesComponent.h"
00006
00007 namespace gplib
00008 {
00009
00010
00011
00012 class SeismicDataComp: public TimeSeriesComponent
00013 {
00014 public:
00015 enum tseismicdataformat
00016 {
00017 unknownseis, sac, sks, head, ascii
00018 };
00019 double GetB() const
00020 {
00021 return b;
00022 }
00023 void SetB(const double theb)
00024 {
00025 b = theb;
00026 }
00027 tseismicdataformat GetFormat()
00028 {
00029 return dataformat;
00030 }
00031
00032 double GetStLa() const
00033 {
00034 return stla;
00035 }
00036
00037 void SetStLa(const double lat)
00038 {
00039 stla = lat;
00040 }
00041
00042 double GetStLo() const
00043 {
00044 return stlo;
00045 }
00046
00047 void SetStLo(const double lon)
00048 {
00049 stla = lon;
00050 }
00051
00052 double GetStEl() const
00053 {
00054 return stel;
00055 }
00056
00057 double GetStDp() const
00058 {
00059 return stdp;
00060 }
00061
00062 double GetEvLa() const
00063 {
00064 return evla;
00065 }
00066
00067 double GetEvLo() const
00068 {
00069 return evlo;
00070 }
00071
00072 double GetEvEl() const
00073 {
00074 return evel;
00075 }
00076
00077 double GetEvDp() const
00078 {
00079 return evdp;
00080 }
00081
00082 double GetMag() const
00083 {
00084 return mag;
00085 }
00086
00087 double GetDist() const
00088 {
00089 return dist;
00090 }
00091
00092 double GetAz() const
00093 {
00094 return az;
00095 }
00096
00097 double GetBaz() const
00098 {
00099 return baz;
00100 }
00101
00102 double GetGcarc() const
00103 {
00104 return gcarc;
00105 }
00106
00107 int
00108 ReadData(const std::string &filename, tseismicdataformat format = sac);
00109
00110 int WriteAsSac(const std::string &filename) const;
00111
00112 int WriteAsAscii(const std::string &filename) const;
00113
00114 int WriteBack() const;
00115
00116 void CopyHeader(const SeismicDataComp& source);
00117 SeismicDataComp(const std::string &filename, tseismicdataformat format =
00118 sac);
00119 SeismicDataComp();
00120 virtual ~SeismicDataComp();
00121 virtual SeismicDataComp& operator=(const SeismicDataComp& source);
00122 private:
00123 double stla;
00124 double stlo;
00125 double stel;
00126 double stdp;
00127 double evla;
00128 double evlo;
00129 double evel;
00130 double evdp;
00131 double mag;
00132 double dist;
00133 double az;
00134 double baz;
00135 double gcarc;
00136
00137 double b;
00138
00139 tseismicdataformat dataformat;
00140 void ReadSac(const std::string &filename);
00141 void ReadHeaderAscii(const std::string &filename);
00142 void ReadSKS(const std::string &filename);
00143 void ReadAscii(const std::string &filename);
00144 };
00145
00146 }
00147 #endif // CSEISMICDATACOMP_H