GPLIB++
|
TimeSeriesComponent is the base storage class for all types of time series data. More...
#include <TimeSeriesComponent.h>
Public Types | |
typedef std::vector< double > ::iterator | tdatait |
Public Member Functions | |
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 () |
TimeSeriesComponent is the base storage class for all types of time series data.
This is the base class for both MT and Seismic data, all common functionality will be in this class. Furthermore all functions should be implemented to use this class unless they need functionality specific to the method. We inherit from ring_operators to provide a set of useful mathematical operators with minimum implementation
Definition at line 22 of file TimeSeriesComponent.h.
typedef std::vector<double>::iterator gplib::TimeSeriesComponent::tdatait |
Definition at line 35 of file TimeSeriesComponent.h.
gplib::TimeSeriesComponent::TimeSeriesComponent | ( | const TimeSeriesComponent & | source | ) |
Definition at line 23 of file TimeSeriesComponent.cpp.
gplib::TimeSeriesComponent::TimeSeriesComponent | ( | ) |
Definition at line 14 of file TimeSeriesComponent.cpp.
|
virtual |
Definition at line 19 of file TimeSeriesComponent.cpp.
|
inline |
Access for data vector, for ease of use and efficiency we return a reference.
Definition at line 37 of file TimeSeriesComponent.h.
Referenced by gplib::ApplyFilter::AddInputChannel(), gplib::ApplyFilter::AddReferenceChannel(), gplib::MultiRecCalc::CalcRecData(), gplib::RecCalc::CalcRecData(), gplib::MoveoutCorrection::DoCorrection(), init(), main(), Normalize(), gplib::C1DRecObjective::PostParallel(), Restore(), gplib::SeismicDataComp::WriteAsAscii(), and gplib::SeismicDataComp::WriteAsSac().
|
inline |
Definition at line 41 of file TimeSeriesComponent.h.
|
inline |
Return dt in s.
Definition at line 65 of file TimeSeriesComponent.h.
Referenced by gplib::RecCalc::CalcRecData(), gplib::MoveoutCorrection::DoCorrection(), main(), gplib::SeismicDataComp::WriteAsAscii(), and gplib::SeismicDataComp::WriteAsSac().
|
inline |
Return name of the component.
Definition at line 70 of file TimeSeriesComponent.h.
Referenced by main(), and gplib::SeismicDataComp::WriteBack().
|
inline |
Return samplerate in Hz.
Definition at line 50 of file TimeSeriesComponent.h.
Referenced by gplib::TimeSeries::GetSamplerate().
TimeSeriesComponent & gplib::TimeSeriesComponent::operator*= | ( | const double | factor | ) |
Multiply each element of the time series by a constant factor.
Definition at line 115 of file TimeSeriesComponent.cpp.
Referenced by operator/=().
TimeSeriesComponent & gplib::TimeSeriesComponent::operator+= | ( | const double | shift | ) |
Add a constant shift to each element of the time series.
Definition at line 129 of file TimeSeriesComponent.cpp.
Referenced by operator-=().
TimeSeriesComponent & gplib::TimeSeriesComponent::operator+= | ( | const TimeSeriesComponent & | other | ) |
Add two time series point by point and store the result in the current object.
Definition at line 136 of file TimeSeriesComponent.cpp.
TimeSeriesComponent & gplib::TimeSeriesComponent::operator-= | ( | const double | shift | ) |
Substract a constant shift from each element of the time series.
Definition at line 143 of file TimeSeriesComponent.cpp.
References operator+=().
TimeSeriesComponent & gplib::TimeSeriesComponent::operator-= | ( | const TimeSeriesComponent & | other | ) |
Substract two time series point by point and store the result in the current object.
Definition at line 149 of file TimeSeriesComponent.cpp.
TimeSeriesComponent & gplib::TimeSeriesComponent::operator/= | ( | const double | numerator | ) |
Devide each element of the time series by a constant number.
Definition at line 122 of file TimeSeriesComponent.cpp.
References operator*=().
TimeSeriesComponent & gplib::TimeSeriesComponent::operator= | ( | const TimeSeriesComponent & | source | ) |
Definition at line 65 of file TimeSeriesComponent.cpp.
Referenced by gplib::SeismicDataComp::operator=().
|
inline |
Set delta t in s.
Definition at line 60 of file TimeSeriesComponent.h.
Referenced by gplib::MultiRecCalc::CalcRecData(), and gplib::RecCalc::CalcRecData().
|
inline |
Modify name of the component.
Definition at line 75 of file TimeSeriesComponent.h.
Referenced by gplib::SeismicDataComp::ReadData().
|
inline |
Set sampling rate in Hz.
Definition at line 55 of file TimeSeriesComponent.h.
void gplib::TimeSeriesComponent::ShiftEnd | ( | const int | npts | ) |
Shift the end of the recording by npts points.
if npts < 0 we cut abs(npts) from the end, otherwise we add npts 0s at the end
Definition at line 51 of file TimeSeriesComponent.cpp.
void gplib::TimeSeriesComponent::ShiftStart | ( | const int | npts | ) |
Shift the start of the recording by npts points.
if npts < 0 we cut abs(npts) from the beginning, otherwise we add npts 0s at the beginning this will also adjust the starttime accordingly
Definition at line 29 of file TimeSeriesComponent.cpp.