265 {
266 if (head) {
268 stringstream ss;
269 ss << "CosineTaper::apply: inconsistent head taper parameters" << endl
270 <<
"Data endtime=" << d.
endtime()
271 << " which is earlier than start of head taper=" << t0head << endl
272 << "Data vector was not altered" << endl;
273 d.elog.
log_error(
"CosineTaper", ss.str(), ErrorSeverity::Complaint);
274 return -1;
275 }
276 int is;
277 double t, wt;
278 for (t = d.
t0(); t < t0head; t += d.
dt()) {
280 if (is >= 0 && is < d.
npts()) {
281 for (int k = 0; k < 3; ++k)
283 }
284 }
285 for (t = t0head; t < t1head; t += d.
dt()) {
287 if (is >= 0) {
288 wt = headcos(t0head, t1head, t);
289 for (int k = 0; k < 3; ++k)
291 }
292 }
293 }
294 if (tail) {
295 if (d.
t0() > t0tail) {
296 stringstream ss;
297 ss << "CosineTaper::apply: inconsistent tail taper parameters" << endl
298 <<
"Data start time=" << d.
t0()
299 << " is after the end of the tail taper = " << t0tail << endl
300 << "Data vector was not altered" << endl;
301 d.elog.
log_error(
"CosineTaper", ss.str(), ErrorSeverity::Complaint);
302 return -1;
303 }
304 int is;
305 double t, wt;
306 for (t = d.
endtime(); t >= t0tail; t -= d.
dt()) {
308 if (is >= 0 && is < d.
npts()) {
309 for (int k = 0; k < 3; ++k)
311 }
312 }
313 for (t = t1tail; t < t0tail; t += d.
dt()) {
315 if (is >= 0) {
316 wt = tailcos(t0tail, t1tail, t);
317 for (int k = 0; k < 3; ++k)
319 }
320 }
321 }
322 return 0;
323}
size_t npts() const
Definition BasicTimeSeries.h:171
double t0() const
Definition BasicTimeSeries.h:174
int sample_number(double t) const
Definition BasicTimeSeries.h:72
double dt() const
Definition BasicTimeSeries.h:153
mspass::utility::dmatrix u
Definition CoreSeismogram.h:52
double endtime() const noexcept
Definition CoreSeismogram.h:497
int log_error(const mspass::utility::MsPASSError &merr)
Definition ErrorLogger.cc:72