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     /** \addtogroup seistools Seismic data analysis and modeling */
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       //! Return the latitude of the station
00032       double GetStLa() const
00033         {
00034           return stla;
00035         }
00036       //! Set the latitude of the station
00037       void SetStLa(const double lat)
00038         {
00039           stla = lat;
00040         }
00041       //! Get the longitude of the station
00042       double GetStLo() const
00043         {
00044           return stlo;
00045         }
00046       //! Set the longitude of the station
00047       void SetStLo(const double lon)
00048         {
00049           stla = lon;
00050         }
00051       //! Get the elevation of the station in m
00052       double GetStEl() const
00053         {
00054           return stel;
00055         }
00056       //! Get the depth of the station below the ground in m
00057       double GetStDp() const
00058         {
00059           return stdp;
00060         }
00061       //! Get the latitude of the event
00062       double GetEvLa() const
00063         {
00064           return evla;
00065         }
00066       //! Get the longitude of the event
00067       double GetEvLo() const
00068         {
00069           return evlo;
00070         }
00071       //! Get the elevation of the event
00072       double GetEvEl() const
00073         {
00074           return evel;
00075         }
00076       //! Get the depth of the event
00077       double GetEvDp() const
00078         {
00079           return evdp;
00080         }
00081       //! Get the magnitude of the event
00082       double GetMag() const
00083         {
00084           return mag;
00085         }
00086       //! Get the distance between event and station
00087       double GetDist() const
00088         {
00089           return dist;
00090         }
00091       //! Get the azimuth of the event
00092       double GetAz() const
00093         {
00094           return az;
00095         }
00096       //! Get the back-azimuth of the event
00097       double GetBaz() const
00098         {
00099           return baz;
00100         }
00101       //! Get the distance between station and event along a great circle
00102       double GetGcarc() const
00103         {
00104           return gcarc;
00105         }
00106       //! Read in data from a file, as we cannot determine the type from the ending we have to provide it
00107       int
00108           ReadData(const std::string &filename, tseismicdataformat format = sac);
00109       //! Write the data in sac binary format
00110       int WriteAsSac(const std::string &filename) const;
00111       //! Write the data in plain ascii format
00112       int WriteAsAscii(const std::string &filename) const;
00113       //! Write the data in the format it was read in and with the same filename
00114       int WriteBack() const;
00115       //! Copy the information in the header from another object
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       //std::string name;
00137       double b; // Time Shift between origin time of eq and beginning of data
00138       //ttsdata Data;
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

Generated on Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8