Commit a8d2c2d1 authored by doetschj's avatar doetschj
Browse files

Allowing gaps in waveform data

parent 8900e046
......@@ -46,12 +46,13 @@ def cli(ctx, cfg, verbose, mode, log):
"""
# kill leftover celery workers
#os.system("pkill -9 - f 'celery worker'")
#os.system("pkill -9 -f 'celery worker'")
os.system("pkill -9 -f 'redis-server'")
# Setup logging. By default we log to stdout with ERROR level and to a log
# file (if specified) with INFO level. Setting verbose logs to both
# handlers with DEBUG level.
logger = logging.getLogger('dug-seis')
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s %(levelname)-7s %(message)s')
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG if verbose else logging.INFO)
......
......@@ -20,7 +20,6 @@ import pyasdf
from dug_seis.processing.dug_trigger import dug_trigger
from dug_seis.processing.event_processing import event_processing
import re
import numpy as np
def processing(param):
......@@ -83,9 +82,17 @@ def processing(param):
for k in stations:
sta += ds.waveforms[wf_list[k]].raw_recording
sta_copy = sta.copy()
sta_total = sta_copy + sta_overlap
# no overlap, if more than 10 samples are missing
if not len(sta_overlap):
sta_total = sta_copy
else:
if sta.traces[0].stats["starttime"]-sta_overlap.traces[0].stats["endtime"] > 10./param['Acquisition']['hardware_settings']['sampling_frequency']:
sta_total = sta_copy
logger.info('Gap in waveform data found.')
else:
sta_total = sta_overlap + sta_copy
# Use overlap statement for merging
# Use merge statement for merging
for tr in sta_total:
tr.stats.delta = sta_total[0].stats.delta
sta_total.merge(method=1, interpolation_samples=0)
......@@ -94,9 +101,9 @@ def processing(param):
for k in stations:
sta_total.traces[k].data = sta_total.traces[k].data / 32768 * \
param['Acquisition']['hardware_settings']['gain_selection'][k]
logging.info('Gain range trigger retrieved from YAML file')
logger.info('Gain range trigger retrieved from YAML file')
logging.debug(sta_total)
logger.debug(sta_total)
trigger_out, event_nr = dug_trigger(sta_total, tparam, event_nr, event_nr_s) # run trigger function
overlap = tparam['starttime'] + tparam['endtime'] #+ tparam['endtime']['sta_lta']['lt_window']/sta_total.stats.sampling_rate
......
just a dummy file
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment