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

Taper front and/or end of a time seris with a half cosine function. More...

#include <Taper.h>

Inheritance diagram for mspass::algorithms::CosineTaper:
mspass::algorithms::BasicTaper

Public Member Functions

 CosineTaper (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

Taper front and/or end of a time seris with a half cosine function.

A sine taper is a common, simple approach to taper data. When applied at the front it defnes a half cycle of a cosine curve +1.0 in range -pi to 0. On the right it defines the same function for the range 0 to pi. The period of the left and right operator can be different. Turn off left or right by giving illegal start and end points and the operator will silently be only one sided.

Constructor & Destructor Documentation

◆ CosineTaper()

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

primary constructor.

Defines half-cycle sine taper for front and/or back end of a time range. Zero times before t0head and after t0tail. Taper between t0head and t1head and in opposite sense from t1tail to t0tail.

206 {
207  t0head=t0h;
208  t1head=t1h;
209  t0tail=t0t;
210  t1tail=t1t;
211  if(t1head>t0head) head=true;
212  if(t1tail<t0tail) tail=true;
213  if(head&&tail)
214  all=true;
215  else
216  all=false;
217  if(!(head || tail))
218  {
219  stringstream ss;
220  ss << "CosineTaper constructor: illegal input. No valid taper parameters"<<endl
221  << "Input defines front end ramp defined as 0 at "<<t0h<<" rising to 1 at "<<t1h<<endl
222  << "Tail end ramp defined with 1 at "<<t1t<<" dropping to 0 at "<<t0t<<endl;
223  throw MsPASSError(ss.str(),ErrorSeverity::Invalid);
224  }
225 }
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: