TS++ library: time series library

◆ pick()

Pick ts::tapers::ovtaper::Picks::pick ( const double &  offset) const

return interpolated pick for given offset

Definition at line 90 of file ovtaper.cc.

References Mpicks, ts::tapers::ovtaper::Pick::t, and ts::tapers::ovtaper::Pick::x.

Referenced by time().

91  {
92  Pick p(offset);
93  if (!Mpicks.empty())
94  {
95  Tlistofpick::const_iterator P=Mpicks.begin();
96  if ((*P) > p)
97  {
98  p.t=P->t;
99  }
100  else
101  {
102  Tlistofpick::const_iterator Pp=P;
103  while ((P!=Mpicks.end()) && (*P<p)) { Pp=P; P++; }
104  if (P==Pp)
105  {
106  p.t=P->t;
107  }
108  else if (P==Mpicks.end())
109  {
110  p.t=Pp->t;
111  }
112  else
113  {
114  p.t=Pp->t+(P->t-Pp->t)*(p.x-Pp->x)/(P->x-Pp->x);
115  }
116  }
117  }
118  return p;
119  } // Pick Picks::pick(const double& offset) const
Tlistofpick Mpicks
picks
Definition: ovtaper.h:88
Here is the caller graph for this function: