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

TimeSeriesComponent is the base storage class for all types of time series data. More...

#include <TimeSeriesComponent.h>

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

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...
 
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

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.

Member Typedef Documentation

typedef std::vector<double>::iterator gplib::TimeSeriesComponent::tdatait

Definition at line 35 of file TimeSeriesComponent.h.

Constructor & Destructor Documentation

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.

gplib::TimeSeriesComponent::~TimeSeriesComponent ( )
virtual

Definition at line 19 of file TimeSeriesComponent.cpp.

Member Function Documentation

std::vector<double>& gplib::TimeSeriesComponent::GetData ( )
inline
const std::vector<double>& gplib::TimeSeriesComponent::GetData ( ) const
inline

Definition at line 41 of file TimeSeriesComponent.h.

double gplib::TimeSeriesComponent::GetDt ( ) const
inline
std::string gplib::TimeSeriesComponent::GetName ( ) const
inline

Return name of the component.

Definition at line 70 of file TimeSeriesComponent.h.

Referenced by main(), and gplib::SeismicDataComp::WriteBack().

double gplib::TimeSeriesComponent::GetSamplerate ( ) const
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=().

void gplib::TimeSeriesComponent::SetDt ( const double  dt)
inline

Set delta t in s.

Definition at line 60 of file TimeSeriesComponent.h.

Referenced by gplib::MultiRecCalc::CalcRecData(), and gplib::RecCalc::CalcRecData().

void gplib::TimeSeriesComponent::SetName ( const std::string &  n)
inline

Modify name of the component.

Definition at line 75 of file TimeSeriesComponent.h.

Referenced by gplib::SeismicDataComp::ReadData().

void gplib::TimeSeriesComponent::SetSamplerate ( const double  rate)
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.


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