version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
mspass::algorithms::TimeWindow Class Reference

Defines a time window. More...

#include <TimeWindow.h>

Public Member Functions

 TimeWindow ()
 
 TimeWindow (const double ts, const double te)
 
 TimeWindow (const TimeWindow &parent)
 
TimeWindowoperator= (const TimeWindow &parent)
 
TimeWindow shift (const double tshift) const
 
double length ()
 

Public Attributes

double start
 
double end
 

Detailed Description

Defines a time window.

Time windows are a common concept in time series analysis and seismology in particular. The object definition here has no concept of a time standard. It simply defines an interval in terms of a pair of real numbers.

Constructor & Destructor Documentation

◆ TimeWindow() [1/3]

mspass::algorithms::TimeWindow::TimeWindow ( )
inline

Default constructor.

25 {
26 start = 0.0;
27 end = 1.0e99;
28 };
double start
Definition TimeWindow.h:17
double end
Definition TimeWindow.h:21

References end, and start.

◆ TimeWindow() [2/3]

mspass::algorithms::TimeWindow::TimeWindow ( const double  ts,
const double  te 
)
inline

Parameterized constructor.

Parameters
ts- start time
te- end time
34 {
35 start = ts;
36 end = te;
37 };

References end, and start.

◆ TimeWindow() [3/3]

mspass::algorithms::TimeWindow::TimeWindow ( const TimeWindow parent)
inline
38 {
39 start = parent.start;
40 end = parent.end;
41 }

Member Function Documentation

◆ length()

double mspass::algorithms::TimeWindow::length ( )
inline

Returns the window length

61{ return (end - start); };

References end, and start.

◆ operator=()

TimeWindow & mspass::algorithms::TimeWindow::operator= ( const TimeWindow parent)
inline
42 {
43 if (&parent != this) {
44 start = parent.start;
45 end = parent.end;
46 }
47 return *this;
48 }

◆ shift()

TimeWindow mspass::algorithms::TimeWindow::shift ( const double  tshift) const
inline

Returns a new time window translated by tshift argument.

52 {
53 TimeWindow newwindow(*this);
54 newwindow.start += tshift;
55 newwindow.end += tshift;
56 return (newwindow);
57 }
TimeWindow()
Definition TimeWindow.h:25

References end, and start.

Member Data Documentation

◆ end

double mspass::algorithms::TimeWindow::end

End time of the window.

◆ start

double mspass::algorithms::TimeWindow::start

Start time of the window.


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