Skip to content
Snippets Groups Projects
Commit bac04f9e authored by Cain, Payton David's avatar Cain, Payton David
Browse files

Check for data length in process_step

parent 46b5cb9a
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!17Implement hourly/daily filtering products
......@@ -267,6 +267,9 @@ class FilterAlgorithm(Algorithm):
self.align_trace(step, trace)
# data to filter
data = trace.data
# check that there is still enough data to filter
if len(data) < numtaps:
continue
filtered = self.firfilter(data, window, decimation)
stats = Stats(trace.stats)
stats.delta = output_sample_period
......@@ -301,10 +304,6 @@ class FilterAlgorithm(Algorithm):
input_starttime = starttime - shift
offset = int(1e-6 + (input_starttime - start) / step["input_sample_period"])
data = data[offset:]
# check that there is still enough data to filter
if len(data) < numtaps:
data = []
starttime = starttime - step["input_sample_period"]
trace.stats.starttime = starttime
trace.data = data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment