TS++ library: time series library

◆ taper()

ts::tapers::FourPoint ts::tapers::OffsetVariableTaper::taper ( const double &  offset,
const double &  T0,
const double &  T 
) const

return specific four point taper

Parameters
offsetcreate specific taper for receiver at offset
T0time of first sample with respect to source time
Tduration of time series to be tapered
Returns
four point taper for this offset and time series

Definition at line 133 of file ovtaper.cc.

References Mt1, Mt2, Mt3, Mt4, Mvalid, t1(), t2(), t3(), t4(), ts::tapers::ovtaper::Picks::time(), and TSXX_assert.

Referenced by main().

136  {
138  "OffsetVariableTaper::taper: "
139  "taper is undefined");
140  // calculate times in units of the duration of the time series
141  double t1=(Mt1.time(offset)-T0)/T;
142  double t2=(Mt2.time(offset)-T0)/T;
143  double t3=(Mt3.time(offset)-T0)/T;
144  double t4=(Mt4.time(offset)-T0)/T;
145  // keep values in bounds of time series
146  t1 = t1 >= 0. ? t1 : 0.;
147  t2 = t2 >= 1.e-6 ? t2 : 1.e-6;
148  t3 = t3 <= .99999 ? t3 : .99999;
149  t4 = t4 <= 1. ? t4 : 1.;
150  // initialize taper
151  ts::tapers::FourPoint fpt(t1, t2, t3, t4);
152  return(fpt);
153  } // ts::tapers::FourPoint OffsetVariableTaper::taper(...)
double time(const double &offset) const
return time for interpolated pick at given offset
Definition: ovtaper.cc:123
ovtaper::Picks t1() const
Definition: ovtaper.h:132
ovtaper::Picks Mt1
taper picks
Definition: ovtaper.h:142
ovtaper::Picks t3() const
Definition: ovtaper.h:134
#define TSXX_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:127
ovtaper::Picks t4() const
Definition: ovtaper.h:135
ovtaper::Picks t2() const
Definition: ovtaper.h:133
Provides a 4-point taper.
Definition: tapers.h:140
bool Mvalid
true if taper definition is present
Definition: ovtaper.h:140
Here is the call graph for this function:
Here is the caller graph for this function: