GPLIB++
|
#include <SeismicDataComp.h>
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 SeismicDataComp & | operator= (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... | |
TimeSeriesComponent & | operator= (const TimeSeriesComponent &source) |
TimeSeriesComponent & | operator*= (const double factor) |
Multiply each element of the time series by a constant factor. More... | |
TimeSeriesComponent & | operator/= (const double numerator) |
Devide each element of the time series by a constant number. More... | |
TimeSeriesComponent & | operator+= (const double shift) |
Add a constant shift to each element of the time series. More... | |
TimeSeriesComponent & | operator-= (const double shift) |
Substract a constant shift from each element of the time series. More... | |
TimeSeriesComponent & | operator+= (const TimeSeriesComponent &other) |
Add two time series point by point and store the result in the current object. More... | |
TimeSeriesComponent & | operator-= (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 () |
Definition at line 12 of file SeismicDataComp.h.
Enumerator | |
---|---|
unknownseis | |
sac | |
sks | |
head | |
ascii |
Definition at line 15 of file SeismicDataComp.h.
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.
|
virtual |
Definition at line 28 of file SeismicDataComp.cpp.
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().
|
inline |
Get the azimuth of the event.
Definition at line 92 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Definition at line 19 of file SeismicDataComp.h.
Referenced by gplib::MoveoutCorrection::DoCorrection(), and main().
|
inline |
Get the back-azimuth of the event.
Definition at line 97 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the distance between event and station.
Definition at line 87 of file SeismicDataComp.h.
Referenced by main().
|
inline |
|
inline |
Get the elevation of the event.
Definition at line 72 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the latitude of the event.
Definition at line 62 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the longitude of the event.
Definition at line 67 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Definition at line 27 of file SeismicDataComp.h.
|
inline |
Get the distance between station and event along a great circle.
Definition at line 102 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the magnitude of the event.
Definition at line 82 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the depth of the station below the ground in m.
Definition at line 57 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the elevation of the station in m.
Definition at line 52 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Return the latitude of the station.
Definition at line 32 of file SeismicDataComp.h.
Referenced by main().
|
inline |
Get the longitude of the station.
Definition at line 42 of file SeismicDataComp.h.
Referenced by main().
|
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().
|
inline |
Definition at line 23 of file SeismicDataComp.h.
Referenced by gplib::MultiRecCalc::CalcRecData(), and gplib::RecCalc::CalcRecData().
|
inline |
Set the latitude of the station.
Definition at line 37 of file SeismicDataComp.h.
|
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().