TimeSeriesComponent Class Reference
[Time series analysis methods]

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

#include <TimeSeriesComponent.h>

Inheritance diagram for TimeSeriesComponent:

Inheritance graph
[legend]

List of all members.

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.
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.
double GetSamplerate () const
 Return samplerate in Hz.
void SetSamplerate (const double rate)
 Set sampling rate in Hz.
void SetDt (const double dt)
 Set delta t in s.
double GetDt () const
 Return dt in s.
std::string GetName () const
 Return name of the component.
void SetName (const std::string &n)
 Modify name of the component.
void Resample (const double newdt)
 resample to a new dt by interpolation
void ShiftStart (const int npts)
 Shift the start of the recording by npts points.
void ShiftEnd (const int npts)
 Shift the end of the recording by npts points.
TimeSeriesComponentoperator= (const TimeSeriesComponent &source)
TimeSeriesComponentoperator*= (const double factor)
 Multiply each element of the time series by a constant factor.
TimeSeriesComponentoperator/= (const double numerator)
 Devide each element of the time series by a constant number.
TimeSeriesComponentoperator+= (const double shift)
 Add a constant shift to each element of the time series.
TimeSeriesComponentoperator-= (const double shift)
 Substract a constant shift from each element of the time series.
TimeSeriesComponentoperator+= (const TimeSeriesComponent &other)
 Add two time series point by point and store the result in the current object.
TimeSeriesComponentoperator-= (const TimeSeriesComponent &other)
 Substract two time series point by point and store the result in the current object.
 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 19 of file TimeSeriesComponent.h.


Member Typedef Documentation

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

Definition at line 32 of file TimeSeriesComponent.h.


Constructor & Destructor Documentation

TimeSeriesComponent::TimeSeriesComponent ( const TimeSeriesComponent source  ) 

Definition at line 18 of file TimeSeriesComponent.cpp.

TimeSeriesComponent::TimeSeriesComponent (  ) 

Definition at line 9 of file TimeSeriesComponent.cpp.

TimeSeriesComponent::~TimeSeriesComponent (  )  [virtual]

Definition at line 14 of file TimeSeriesComponent.cpp.


Member Function Documentation

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

Definition at line 38 of file TimeSeriesComponent.h.

std::vector<double>& TimeSeriesComponent::GetData (  )  [inline]

double TimeSeriesComponent::GetDt (  )  const [inline]

std::string TimeSeriesComponent::GetName (  )  const [inline]

Return name of the component.

Definition at line 67 of file TimeSeriesComponent.h.

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

double TimeSeriesComponent::GetSamplerate (  )  const [inline]

Return samplerate in Hz.

Definition at line 47 of file TimeSeriesComponent.h.

Referenced by TimeSeries::GetSamplerate().

TimeSeriesComponent & TimeSeriesComponent::operator*= ( const double  factor  ) 

Multiply each element of the time series by a constant factor.

Definition at line 103 of file TimeSeriesComponent.cpp.

Referenced by operator/=().

TimeSeriesComponent & TimeSeriesComponent::operator+= ( const TimeSeriesComponent other  ) 

Add two time series point by point and store the result in the current object.

Definition at line 122 of file TimeSeriesComponent.cpp.

References data.

TimeSeriesComponent & TimeSeriesComponent::operator+= ( const double  shift  ) 

Add a constant shift to each element of the time series.

Definition at line 116 of file TimeSeriesComponent.cpp.

Referenced by operator-=().

TimeSeriesComponent & TimeSeriesComponent::operator-= ( const TimeSeriesComponent other  ) 

Substract two time series point by point and store the result in the current object.

Definition at line 133 of file TimeSeriesComponent.cpp.

References data.

TimeSeriesComponent & TimeSeriesComponent::operator-= ( const double  shift  ) 

Substract a constant shift from each element of the time series.

Definition at line 127 of file TimeSeriesComponent.cpp.

References operator+=().

TimeSeriesComponent & TimeSeriesComponent::operator/= ( const double  numerator  ) 

Devide each element of the time series by a constant number.

Definition at line 109 of file TimeSeriesComponent.cpp.

References operator*=().

TimeSeriesComponent & TimeSeriesComponent::operator= ( const TimeSeriesComponent source  ) 

Definition at line 60 of file TimeSeriesComponent.cpp.

References data, name, samplerate, and starttime.

void TimeSeriesComponent::Resample ( const double  newdt  ) 

resample to a new dt by interpolation

Definition at line 73 of file TimeSeriesComponent.cpp.

References GetDt().

void TimeSeriesComponent::SetDt ( const double  dt  )  [inline]

Set delta t in s.

Definition at line 57 of file TimeSeriesComponent.h.

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

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

Modify name of the component.

Definition at line 72 of file TimeSeriesComponent.h.

Referenced by SeismicDataComp::ReadData(), and TimeSeries::TimeSeries().

void TimeSeriesComponent::SetSamplerate ( const double  rate  )  [inline]

Set sampling rate in Hz.

Definition at line 52 of file TimeSeriesComponent.h.

Referenced by LemiTsFormat::GetData(), and BirrpAsciiFormat::GetData().

void 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 46 of file TimeSeriesComponent.cpp.

void 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 26 of file TimeSeriesComponent.cpp.


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

Generated on Tue Aug 4 16:04:23 2009 for GPLIB++ by  doxygen 1.5.8