GPLIB++
Public Types | Public Member Functions | Protected Attributes | List of all members
gplib::TimeSeries Class Referenceabstract

This class is the base class for all classes dealing with MT time series. More...

#include <TimeSeries.h>

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

Public Types

typedef boost::posix_time::ptime ttime
 We use the boost library time functionality for time types and store the time for each point in a vector. More...
 
typedef std::vector< ttimettimedata
 

Public Member Functions

TimeSeriesComponentGetHx ()
 Access function for Hx, returns reference for efficiency. More...
 
TimeSeriesComponentGetHy ()
 
TimeSeriesComponentGetHz ()
 
TimeSeriesComponentGetEx ()
 
TimeSeriesComponentGetEy ()
 
ttimedataGetTime ()
 
size_t Size ()
 Return the size of the time series, throws if one of the components has a different size. More...
 
virtual void GetData (const std::string filename)=0
 
virtual void WriteData (const std::string filename)=0
 
double GetSamplerate ()
 The samplerate is stored in each component, we just return the samplerate of Hx assuming they are all equal. More...
 
 TimeSeries ()
 
virtual ~TimeSeries ()
 
TimeSeriesoperator= (const TimeSeries &source)
 
TimeSeriesoperator*= (const double &factor)
 Multiply all components by a constant factor. More...
 
TimeSeriesoperator+= (const double &shift)
 Add a constant shift to all components. More...
 
void erase (const int startindex, const int endindex)
 Erase data between startindex and endindex. More...
 

Protected Attributes

TimeSeriesComponent Hx
 The data for the north-south magnetic field. More...
 
TimeSeriesComponent Hy
 The data for the east-west magnetic field. More...
 
TimeSeriesComponent Hz
 The data for the vertical magnetic field. More...
 
TimeSeriesComponent Ex
 The data for the north-south electric field. More...
 
TimeSeriesComponent Ey
 The data for the east-west electric field. More...
 
ttimedata t
 The time associated with each data point. More...
 

Detailed Description

This class is the base class for all classes dealing with MT time series.

Definition at line 14 of file TimeSeries.h.

Member Typedef Documentation

typedef boost::posix_time::ptime gplib::TimeSeries::ttime

We use the boost library time functionality for time types and store the time for each point in a vector.

Definition at line 18 of file TimeSeries.h.

typedef std::vector<ttime> gplib::TimeSeries::ttimedata

Definition at line 19 of file TimeSeries.h.

Constructor & Destructor Documentation

gplib::TimeSeries::TimeSeries ( )

Definition at line 12 of file TimeSeries.cpp.

gplib::TimeSeries::~TimeSeries ( )
virtual

Definition at line 21 of file TimeSeries.cpp.

Member Function Documentation

void gplib::TimeSeries::erase ( const int  startindex,
const int  endindex 
)

Erase data between startindex and endindex.

Definition at line 59 of file TimeSeries.cpp.

References GetData().

Referenced by main(), and gplib::Synchronize().

virtual void gplib::TimeSeries::GetData ( const std::string  filename)
pure virtual

Declaration for GetData() that reads data from a file. This is intended for use with external data, such as recorded data, or synthetic data from external programs.

Implemented in gplib::MtuFormat, gplib::LemiTsFormat, gplib::BirrpAsciiFormat, and gplib::CsvFormat.

Referenced by erase().

TimeSeriesComponent& gplib::TimeSeries::GetEx ( )
inline

Definition at line 47 of file TimeSeries.h.

References Ex.

Referenced by main().

TimeSeriesComponent& gplib::TimeSeries::GetEy ( )
inline

Definition at line 51 of file TimeSeries.h.

References Ey.

Referenced by main().

TimeSeriesComponent& gplib::TimeSeries::GetHx ( )
inline

Access function for Hx, returns reference for efficiency.

Definition at line 35 of file TimeSeries.h.

References Hx.

Referenced by main().

TimeSeriesComponent& gplib::TimeSeries::GetHy ( )
inline

Definition at line 39 of file TimeSeries.h.

References Hy.

Referenced by main().

TimeSeriesComponent& gplib::TimeSeries::GetHz ( )
inline

Definition at line 43 of file TimeSeries.h.

References Hz.

Referenced by main().

double gplib::TimeSeries::GetSamplerate ( )
inline

The samplerate is stored in each component, we just return the samplerate of Hx assuming they are all equal.

Definition at line 71 of file TimeSeries.h.

References Ex, Ey, gplib::TimeSeriesComponent::GetSamplerate(), Hx, Hy, and Hz.

Referenced by main(), and gplib::Synchronize().

ttimedata& gplib::TimeSeries::GetTime ( )
inline

Definition at line 55 of file TimeSeries.h.

References t.

Referenced by main(), and gplib::Synchronize().

TimeSeries & gplib::TimeSeries::operator*= ( const double &  factor)

Multiply all components by a constant factor.

Definition at line 39 of file TimeSeries.cpp.

TimeSeries & gplib::TimeSeries::operator+= ( const double &  shift)

Add a constant shift to all components.

Definition at line 49 of file TimeSeries.cpp.

TimeSeries & gplib::TimeSeries::operator= ( const TimeSeries source)

Definition at line 25 of file TimeSeries.cpp.

References Ex, Ey, Hx, Hy, Hz, and t.

size_t gplib::TimeSeries::Size ( )

Return the size of the time series, throws if one of the components has a different size.

Definition at line 74 of file TimeSeries.cpp.

Referenced by main().

virtual void gplib::TimeSeries::WriteData ( const std::string  filename)
pure virtual

The abstract declaration for a method that writes the data to a file. Therefore no version without a filename is present

Implemented in gplib::MtuFormat, gplib::BirrpAsciiFormat, gplib::LemiTsFormat, and gplib::CsvFormat.

Member Data Documentation

TimeSeriesComponent gplib::TimeSeries::Ex
protected

The data for the north-south electric field.

Definition at line 28 of file TimeSeries.h.

Referenced by GetEx(), GetSamplerate(), and operator=().

TimeSeriesComponent gplib::TimeSeries::Ey
protected

The data for the east-west electric field.

Definition at line 30 of file TimeSeries.h.

Referenced by GetEy(), GetSamplerate(), and operator=().

TimeSeriesComponent gplib::TimeSeries::Hx
protected

The data for the north-south magnetic field.

Definition at line 22 of file TimeSeries.h.

Referenced by GetHx(), GetSamplerate(), and operator=().

TimeSeriesComponent gplib::TimeSeries::Hy
protected

The data for the east-west magnetic field.

Definition at line 24 of file TimeSeries.h.

Referenced by GetHy(), GetSamplerate(), and operator=().

TimeSeriesComponent gplib::TimeSeries::Hz
protected

The data for the vertical magnetic field.

Definition at line 26 of file TimeSeries.h.

Referenced by GetHz(), GetSamplerate(), and operator=().

ttimedata gplib::TimeSeries::t
protected

The time associated with each data point.

Definition at line 32 of file TimeSeries.h.

Referenced by GetTime(), and operator=().


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