MsPASS C++ API  2.4.1.dev4+g92330b7a
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

Standard copy constructor.

Parameters
parentsource window to copy.
41 {
42 start = parent.start;
43 end = parent.end;
44 }

References end, and start.

Member Function Documentation

◆ length()

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

Returns the window length

68{ return (end - start); };

References end, and start.

◆ operator=()

TimeWindow & mspass::algorithms::TimeWindow::operator= ( const TimeWindow parent)
inline

Standard assignment operator.

Parameters
parentsource window to assign from.
Returns
reference to this window after assignment.
49 {
50 if (&parent != this) {
51 start = parent.start;
52 end = parent.end;
53 }
54 return *this;
55 }

References end, and start.

◆ shift()

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

Returns a new time window translated by tshift argument.

59 {
60 TimeWindow newwindow(*this);
61 newwindow.start += tshift;
62 newwindow.end += tshift;
63 return (newwindow);
64 }
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: