LISOUSI: Line Source Simulation

◆ applytaper()

Tseries applytaper ( const Tseries::Tcoc &  input,
const Tseries::Tcoc &  taper,
const double &  factor,
const double &  dt,
const double &  offset,
const Options opt 
)

Definition at line 41 of file applytaper.cc.

References Options::debug, Options::tapdel, taper, Options::tapslo, Options::tapsloset, and Options::verbose.

Referenced by tdtapertransformation().

44 {
45  if (opt.verbose)
46  {
47  cout << " apply taper function"
48  << " with delay: " << dt*int(opt.tapdel/dt) << "s"
49  << endl;
50  }
51  TFXX_debug(opt.debug, "applytaper", "apply taper to time series\n"
52  << " "
53  << "size of series: " << input.size() << "; "
54  << "size of taper: " << taper.size());
55  // calculate taper delay
56  double taperdelay=opt.tapdel;
57  if (opt.tapsloset)
58  {
59  taperdelay=taperdelay<opt.tapslo*offset ? taperdelay : opt.tapslo*offset;
60  }
61  // prepare return value
62  Tseries retval(0,input.size()-1);
63  retval=Tseries::Tvalue(0.);
64  // prepare iterators
65  aff::Browser<Tseries::Tcoc> IT(taper);
66  aff::Browser<Tseries::Tcoc> II(input);
67  aff::Iterator<Tseries> IS(retval);
68  unsigned int i=0;
69  // apply taper
70  while (IT.valid() && IS.valid() && II.valid())
71  {
72  double t=i*dt;
73  (*IS) = (*II) * (*IT) * factor;
74  ++IS;
75  ++II;
76  if (t >= taperdelay) { ++IT; }
77  ++i;
78  }
79  return(retval);
80 }
Ttimeseries::Tseries Tseries
Definition: lisousi.h:71
bool tapsloset
Definition: lisousi.h:119
double tapdel
Definition: lisousi.h:121
bool debug
Definition: lisousi.h:117
bool verbose
Definition: lisousi.h:117
Tseries taper
Definition: globaldata.cc:47
double tapslo
Definition: lisousi.h:122
Here is the caller graph for this function: