version  0.0.1
Defines the C++ API for MsPASS
Public Member Functions | Friends | List of all members
mspass::algorithms::LinearTaper Class Reference

Used to construct an operator to apply a linear taper to either end. More...

#include <Taper.h>

Inheritance diagram for mspass::algorithms::LinearTaper:
mspass::algorithms::BasicTaper

Public Member Functions

 LinearTaper (const double t0head, const double t1head, const double t1tail, const double t0tail)
 primary constructor. More...
 
int apply (mspass::seismic::TimeSeries &d)
 
int apply (mspass::seismic::Seismogram &d)
 
double get_t0head () const
 
double get_t1head () const
 
double get_t0tail () const
 
double get_t1tail () const
 
- Public Member Functions inherited from mspass::algorithms::BasicTaper
void enable_head ()
 
void disable_head ()
 
void enable_tail ()
 
void disable_tail ()
 
bool head_is_enabled ()
 
bool tail_is_enable ()
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from mspass::algorithms::BasicTaper
bool head
 
bool tail
 
bool all
 

Detailed Description

Used to construct an operator to apply a linear taper to either end.

Linear tapers are defined here as a time spanning a ramp running from 0 to 1. Data will be zeroed on each end of a 0 mark and a linear weight applied between 0 points and 1 points. Postive ramp slope on left and negative slope ramp on right.

Constructor & Destructor Documentation

◆ LinearTaper()

mspass::algorithms::LinearTaper::LinearTaper ( const double  t0head,
const double  t1head,
const double  t1tail,
const double  t0tail 
)

primary constructor.

Defines linear taper for front and/or back end of a time range. Zero times before t0head and after t0tail. Linear ramp between t0head and t1head and in opposite sense from t1tail to t0tail. Setting 0 value = 1 value should be used as a signal to disable.

16 {
17  t0head=t0h;
18  t1head=t1h;
19  t0tail=t0t;
20  t1tail=t1t;
21  if(t1head>t0head)
22  head=true;
23  else
24  head=false;
25  if(t1tail<t0tail)
26  tail=true;
27  else
28  tail=false;
29  if(head&&tail)
30  all=true;
31  else
32  all=false;
33  if(!(head || tail))
34  {
35  stringstream ss;
36  ss << "LinearTaper constructor: illegal input. No valid taper parameters"<<endl
37  << "Input defines front end ramp defined as 0 at "<<t0h<<" rising to 1 at "<<t1h<<endl
38  << "Tail end ramp defined with 1 at "<<t1t<<" dropping to 0 at "<<t0t<<endl;
39  throw MsPASSError(ss.str(),ErrorSeverity::Invalid);
40  }
41 }
Base class for error object thrown by MsPASS library routines.
Definition: MsPASSError.h:40

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