Commit 6319eeb9 authored by doetschj's avatar doetschj
Browse files

Bug fix for event or noise window across two files.

parent 0c2ada2c
......@@ -16,10 +16,8 @@ import logging
def get_waveforms(param, load_file, trig_time):
aparam = param['Acquisition']
gparam = param['General']
asdf_folder = param['Trigger']['asdf_folder']
#print(gparam['stats']['network'] + '_001')
start_time = trig_time - param['Trigger']['starttime']
end_time = trig_time + param['Trigger']['endtime']
......@@ -49,24 +47,22 @@ def get_waveforms(param, load_file, trig_time):
param['Acquisition']['hardware_settings']['gain_selection'][k]
logging.info('Gain range event retrieved from YAML file')
else:
ds1 = pyasdf.ASDFDataSet(asdf_folder + '/' + load_file[0], mode='r')
ds2 = pyasdf.ASDFDataSet(asdf_folder + '/' + load_file[1], mode='r') #GR_001
if end_time > ds2.waveforms.aparam['stats']['network']+'_001'.raw_recording.traces[0].stats["starttime"]:
if end_time > ds2.waveforms[gparam['stats']['network'] + '_001'].raw_recording.traces[0].stats["starttime"]:
sta_p1 = Stream()
sta_p2 = Stream()
for k in r:
sta_p1 += ds1.get_waveforms(network=gparam['stats']['network'], station=str(int(ch_in[k])).zfill(3), location='00',
channel='001',
starttime=start_time,
endtime=ds1.waveforms.gparam['stats']['network']+'_'+'001'.raw_recording.traces[0].stats["endtime"],
endtime=ds1.waveforms[gparam['stats']['network'] + '_001'].raw_recording.traces[0].stats["endtime"],
tag="raw_recording")
sta_p2 += ds2.get_waveforms(network=gparam['stats']['network'], station=str(int(ch_in[k])).zfill(3), location='00',
channel='001',
starttime=ds2.waveforms.print(gparam['stats']['network'] + '_' +'001').raw_recording.traces[0].stats["starttime"],
starttime=ds2.waveforms[gparam['stats']['network'] + '_001'].raw_recording.traces[0].stats["starttime"],
endtime=end_time,
tag="raw_recording")
wf_stream = sta_p1 + sta_p2
......@@ -81,10 +77,10 @@ def get_waveforms(param, load_file, trig_time):
else:
wf_stream = Stream()
for k in r:
wf_stream += ds1.get_waveforms(network=aparam['stats']['network'], station=str(int(ch_in[k])).zfill(3), location='00',
wf_stream += ds1.get_waveforms(network=gparam['stats']['network'], station=str(int(ch_in[k])).zfill(3), location='00',
channel='001',
starttime=start_time,
endtime=end_time,
endtime=ds1.waveforms[gparam['stats']['network'] + '_001'].raw_recording.traces[0].stats["endtime"],
tag="raw_recording")
if tparam['Gainrange'] == 'YAML':
for k in stations:
......
......@@ -68,7 +68,6 @@ def processing(param):
else:
new_files = sorted([f for f in new_files if int(re.findall('\d+', f)[4]) >= tparam['Min']])
processed_files = []
while 1:
if len(new_files):
......
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