From 28505a750106bcfb9d89163bd227291033c944a0 Mon Sep 17 00:00:00 2001 From: Calum Date: Thu, 25 Jul 2024 16:34:23 +1200 Subject: [PATCH] Drop last sample, not first --- eqcorrscan/utils/pre_processing.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eqcorrscan/utils/pre_processing.py b/eqcorrscan/utils/pre_processing.py index 65123303a..246495857 100644 --- a/eqcorrscan/utils/pre_processing.py +++ b/eqcorrscan/utils/pre_processing.py @@ -129,10 +129,11 @@ def _sanitize_length(st, starttime=None, endtime=None, daylong=False): tr.trim(starttime, endtime) if len(tr.data) == ((endtime - starttime) * tr.stats.sampling_rate) + 1: - Logger.info(f"{tr.id} is overlength dropping first sample") - tr.data = tr.data[1:len(tr.data)] - # TODO: this should adjust the start-time - # tr.stats.starttime += tr.stats.delta + Logger.info(f"{tr.id} between {tr.stats.starttime} and " + f"{tr.stats.endtime} with {tr.stats.npts} samples " + f"is overlength by one sample. Dropping last " + f"sample.") + tr.data = tr.data[0:-1] length = endtime - starttime clip = True elif starttime: