From 5e5df87c39d13a756f90c575a9e965fdef2528d9 Mon Sep 17 00:00:00 2001
From: Abram Claycomb <aclaycomb@usgs.gov>
Date: Tue, 13 Nov 2018 18:36:03 -0700
Subject: [PATCH] re-add output start time calculation

---
 geomagio/algorithm/FilterAlgorithm.py | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/geomagio/algorithm/FilterAlgorithm.py b/geomagio/algorithm/FilterAlgorithm.py
index 3ddddf6d0..b98927cb9 100644
--- a/geomagio/algorithm/FilterAlgorithm.py
+++ b/geomagio/algorithm/FilterAlgorithm.py
@@ -76,16 +76,6 @@ class FilterAlgorithm(Algorithm):
 
         out = Stream()
 
-        trace_channels = []
-
-        for trace in stream:
-            trace_channels += [trace.stats.channel]
-
-        trace_chan_dict1 = dict(zip(self.inchannels, trace_channels))
-        print(trace_chan_dict1)
-        trace_chan_dict2 = dict(zip(trace_channels, self.outchannels))
-        print(trace_chan_dict2)
-
         for trace in stream:
             data = trace.data
             step = self.decimation
@@ -94,9 +84,10 @@ class FilterAlgorithm(Algorithm):
 
             stats = Stats(trace.stats)
             # stats.channel = trace_chan_dict2[stats.channel]
+            stats.starttime = trace.stats.starttime + \
+                    self.numtaps * self.sample_period // 2
             stats.delta = stats.delta * step
-            if 'processing' in stats:
-                stats.pop('processing')
+            # stats.processing.append('[Gaussian Filter]')
             stats.npts = filtered.shape[0]
             trace_out = self.create_trace(
                 stats.channel, stats, filtered)
@@ -129,8 +120,8 @@ class FilterAlgorithm(Algorithm):
 
         # build view into data, with numtaps  chunks separated into
         # overlapping 'rows'
-        shape = data.shape[:-1] + (data.shape[-1] - numtaps + 1,
-                                   numtaps)
+        shape = data.shape[:-1] + \
+                (data.shape[-1] - numtaps + 1, numtaps)
         strides = data.strides + (data.strides[-1],)
         as_s = npls.as_strided(data, shape=shape, strides=strides,
                                writeable=False)
-- 
GitLab