Commit 649003ee authored by doetschj's avatar doetschj
Browse files

Do mV scaling for all traces (not only trigger channels). Also a bug fix in when to load two files.

parent 0ba398b2
......@@ -42,7 +42,7 @@ def get_waveforms(param, load_file, trig_time):
endtime=end_time,
tag="raw_recording")
if tparam['Gainrange'] == 'YAML':
for k in stations:
for k in r:
# print(np.amax(np.absolute(wf_stream.traces[k].data)))
wf_stream.traces[k].data = wf_stream.traces[k].data / 32768 * \
param['Acquisition']['hardware_settings']['gain_selection'][k]
......@@ -70,7 +70,7 @@ def get_waveforms(param, load_file, trig_time):
wf_stream.merge(method=1, interpolation_samples=0)
if tparam['Gainrange'] == 'YAML':
for k in stations:
for k in r:
wf_stream.traces[k].data = wf_stream.traces[k].data / 32768 * \
param['Acquisition']['hardware_settings']['gain_selection'][k]
logging.info('Gain range event retrieved from YAML file')
......@@ -86,7 +86,7 @@ def get_waveforms(param, load_file, trig_time):
endtime=end_time,
tag="raw_recording")
if tparam['Gainrange'] == 'YAML':
for k in stations:
for k in r:
wf_stream.traces[k].data = wf_stream.traces[k].data / 32768 * \
param['Acquisition']['hardware_settings']['gain_selection'][k]
logging.info('Gain range event retrieved from YAML file')
......
......@@ -117,13 +117,11 @@ def processing(param):
classification = [i for i in trigger_out['Classification']]
trig_time=[i for i in trigger_out['Time'][trigger_out['Time'] <t_end-overlap]] #do not store times in overlap
for l in trig_time: #load 2 snippets if event in overlap
if l < sta_copy.traces[0].stats["starttime"]+param['Trigger']['starttime']:
for l in range(0, len(trig_time)):
if trig_time[l] < sta_copy.traces[0].stats["starttime"] + param['Trigger']['starttime']:
load_file = [processed_files[-1], current_file]
else:
load_file = [current_file]
for l in range(0, len(trig_time)):
if param['Processing']['parallel_processing']:
event_processing_celery.delay(param, load_file, trig_time[l], event_id[l], classification[l])
logger.info('Event ' + str(event_id[l]) + ' at ' + str(trig_time[l]) + ' sent to parallel worker.')
......
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