GPLIB++
Public Types | Public Member Functions | List of all members
gplib::SeismicDataComp Class Reference

#include <SeismicDataComp.h>

Inheritance diagram for gplib::SeismicDataComp:
Inheritance graph
[legend]

Public Types

enum  tseismicdataformat {
  unknownseis, sac, sks, head,
  ascii
}
 
- Public Types inherited from gplib::TimeSeriesComponent
typedef std::vector< double >
::iterator 
tdatait
 

Public Member Functions

double GetB () const
 
void SetB (const double theb)
 
tseismicdataformat GetFormat ()
 
double GetStLa () const
 Return the latitude of the station. More...
 
void SetStLa (const double lat)
 Set the latitude of the station. More...
 
double GetStLo () const
 Get the longitude of the station. More...
 
void SetStLo (const double lon)
 Set the longitude of the station. More...
 
double GetStEl () const
 Get the elevation of the station in m. More...
 
double GetStDp () const
 Get the depth of the station below the ground in m. More...
 
double GetEvLa () const
 Get the latitude of the event. More...
 
double GetEvLo () const
 Get the longitude of the event. More...
 
double GetEvEl () const
 Get the elevation of the event. More...
 
double GetEvDp () const
 Get the depth of the event. More...
 
double GetMag () const
 Get the magnitude of the event. More...
 
double GetDist () const
 Get the distance between event and station. More...
 
double GetAz () const
 Get the azimuth of the event. More...
 
double GetBaz () const
 Get the back-azimuth of the event. More...
 
double GetGcarc () const
 Get the distance between station and event along a great circle. More...
 
int ReadData (const std::string &filename, tseismicdataformat format=sac)
 Read in data from a file, as we cannot determine the type from the ending we have to provide it. More...
 
int WriteAsSac (const std::string &filename) const
 Write the data in sac binary format. More...
 
int WriteAsAscii (const std::string &filename) const
 Write the data in plain ascii format. More...
 
int WriteBack () const
 Write the data in the format it was read in and with the same filename. More...
 
void CopyHeader (const SeismicDataComp &source)
 Copy the information in the header from another object. More...
 
 SeismicDataComp (const std::string &filename, tseismicdataformat format=sac)
 
 SeismicDataComp ()
 
virtual ~SeismicDataComp ()
 
virtual SeismicDataCompoperator= (const SeismicDataComp &source)
 
- Public Member Functions inherited from gplib::TimeSeriesComponent
std::vector< double > & GetData ()
 Access for data vector, for ease of use and efficiency we return a reference. More...
 
const std::vector< double > & GetData () const
 
gplib::rvec GetUblasData ()
 For some methods we prefer to get the data as a ublas vector, we return a copy. More...
 
double GetSamplerate () const
 Return samplerate in Hz. More...
 
void SetSamplerate (const double rate)
 Set sampling rate in Hz. More...
 
void SetDt (const double dt)
 Set delta t in s. More...
 
double GetDt () const
 Return dt in s. More...
 
std::string GetName () const
 Return name of the component. More...
 
void SetName (const std::string &n)
 Modify name of the component. More...
 
void ShiftStart (const int npts)
 Shift the start of the recording by npts points. More...
 
void ShiftEnd (const int npts)
 Shift the end of the recording by npts points. More...
 
TimeSeriesComponentoperator= (const TimeSeriesComponent &source)
 
TimeSeriesComponentoperator*= (const double factor)
 Multiply each element of the time series by a constant factor. More...
 
TimeSeriesComponentoperator/= (const double numerator)
 Devide each element of the time series by a constant number. More...
 
TimeSeriesComponentoperator+= (const double shift)
 Add a constant shift to each element of the time series. More...
 
TimeSeriesComponentoperator-= (const double shift)
 Substract a constant shift from each element of the time series. More...
 
TimeSeriesComponentoperator+= (const TimeSeriesComponent &other)
 Add two time series point by point and store the result in the current object. More...
 
TimeSeriesComponentoperator-= (const TimeSeriesComponent &other)
 Substract two time series point by point and store the result in the current object. More...
 
 TimeSeriesComponent (const TimeSeriesComponent &source)
 
 TimeSeriesComponent ()
 
virtual ~TimeSeriesComponent ()
 

Detailed Description

Definition at line 12 of file SeismicDataComp.h.

Member Enumeration Documentation

Enumerator
unknownseis 
sac 
sks 
head 
ascii 

Definition at line 15 of file SeismicDataComp.h.

Constructor & Destructor Documentation

gplib::SeismicDataComp::SeismicDataComp ( const std::string &  filename,
tseismicdataformat  format = sac 
)

Definition at line 20 of file SeismicDataComp.cpp.

References ReadData().

gplib::SeismicDataComp::SeismicDataComp ( )

Definition at line 14 of file SeismicDataComp.cpp.

gplib::SeismicDataComp::~SeismicDataComp ( )
virtual

Definition at line 28 of file SeismicDataComp.cpp.

Member Function Documentation

void gplib::SeismicDataComp::CopyHeader ( const SeismicDataComp source)

Copy the information in the header from another object.

Definition at line 32 of file SeismicDataComp.cpp.

Referenced by gplib::RecCalc::CalcRecData(), operator=(), and gplib::C1DRecObjective::PostParallel().

double gplib::SeismicDataComp::GetAz ( ) const
inline

Get the azimuth of the event.

Definition at line 92 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetB ( ) const
inline

Definition at line 19 of file SeismicDataComp.h.

Referenced by gplib::MoveoutCorrection::DoCorrection(), and main().

double gplib::SeismicDataComp::GetBaz ( ) const
inline

Get the back-azimuth of the event.

Definition at line 97 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetDist ( ) const
inline

Get the distance between event and station.

Definition at line 87 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetEvDp ( ) const
inline

Get the depth of the event.

Definition at line 77 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetEvEl ( ) const
inline

Get the elevation of the event.

Definition at line 72 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetEvLa ( ) const
inline

Get the latitude of the event.

Definition at line 62 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetEvLo ( ) const
inline

Get the longitude of the event.

Definition at line 67 of file SeismicDataComp.h.

Referenced by main().

tseismicdataformat gplib::SeismicDataComp::GetFormat ( )
inline

Definition at line 27 of file SeismicDataComp.h.

double gplib::SeismicDataComp::GetGcarc ( ) const
inline

Get the distance between station and event along a great circle.

Definition at line 102 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetMag ( ) const
inline

Get the magnitude of the event.

Definition at line 82 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetStDp ( ) const
inline

Get the depth of the station below the ground in m.

Definition at line 57 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetStEl ( ) const
inline

Get the elevation of the station in m.

Definition at line 52 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetStLa ( ) const
inline

Return the latitude of the station.

Definition at line 32 of file SeismicDataComp.h.

Referenced by main().

double gplib::SeismicDataComp::GetStLo ( ) const
inline

Get the longitude of the station.

Definition at line 42 of file SeismicDataComp.h.

Referenced by main().

SeismicDataComp & gplib::SeismicDataComp::operator= ( const SeismicDataComp source)
virtual

Definition at line 50 of file SeismicDataComp.cpp.

References CopyHeader(), and gplib::TimeSeriesComponent::operator=().

int gplib::SeismicDataComp::ReadData ( const std::string &  filename,
tseismicdataformat  format = sac 
)

Read in data from a file, as we cannot determine the type from the ending we have to provide it.

Definition at line 134 of file SeismicDataComp.cpp.

References ascii, sac, gplib::TimeSeriesComponent::SetName(), and unknownseis.

Referenced by main(), SeismicDataComp(), and gplib::RecCalc::SynthPostParallel().

void gplib::SeismicDataComp::SetB ( const double  theb)
inline
void gplib::SeismicDataComp::SetStLa ( const double  lat)
inline

Set the latitude of the station.

Definition at line 37 of file SeismicDataComp.h.

void gplib::SeismicDataComp::SetStLo ( const double  lon)
inline

Set the longitude of the station.

Definition at line 47 of file SeismicDataComp.h.

int gplib::SeismicDataComp::WriteAsAscii ( const std::string &  filename) const

Write the data in plain ascii format.

Definition at line 216 of file SeismicDataComp.cpp.

References gplib::TimeSeriesComponent::GetData(), and gplib::TimeSeriesComponent::GetDt().

Referenced by main(), and WriteBack().

int gplib::SeismicDataComp::WriteAsSac ( const std::string &  filename) const

Write the data in sac binary format.

Definition at line 160 of file SeismicDataComp.cpp.

References gplib::TimeSeriesComponent::GetData(), and gplib::TimeSeriesComponent::GetDt().

Referenced by main(), WriteBack(), and gplib::C1DRecObjective::WriteData().

int gplib::SeismicDataComp::WriteBack ( ) const

Write the data in the format it was read in and with the same filename.

Definition at line 227 of file SeismicDataComp.cpp.

References ascii, gplib::TimeSeriesComponent::GetName(), sac, unknownseis, WriteAsAscii(), and WriteAsSac().


The documentation for this class was generated from the following files: