Commit b0fc303d authored by doetschj's avatar doetschj
Browse files

single channel trigger implemented and gain error when not all channels are used solved

parent 62551a44
......@@ -48,12 +48,16 @@ def dug_trigger(sta_total, tparam, event_nr, event_nr_s):
id_int = [int(i[3:6]) for i in trace_id]
id_int.sort() # sort the trace ids of one event
# if the difference between earliest and latest arrival is too small, classification=electronic interference
if diff < float(tparam['classification']['spread_int']):
cla_s = 'electronic'
elif id_int[0] == 1: # if the event has an arrival on the first trace, classification=active
cla_s = 'active'
if len(sta_total.traces) == 1:
cla_s = 'passive'
else:
cla_s = 'passive' # if none of the above are true, classification=passive
if diff < float(tparam['classification']['spread_int']):
cla_s = 'electronic'
elif id_int[0] == 1: # if the event has an arrival on the first trace, classification=active
cla_s = 'active'
else:
cla_s = 'passive' # if none of the above are true, classification=passive
classification_s.append(cla_s) # make a list of classifications for each event
time_s.append(UTCDateTime(time_min.isoformat())) # make a list of earliest arrival times for each event
......
......@@ -51,8 +51,10 @@ def processing(param):
# Initialisation
asdf_folder = tparam['asdf_folder'] # 'raw' # Location of .h5 file
stations = [i - 1 for i in tparam['channels']]
if param['General']['active_trigger_channel'] and param['General']['active_trigger_channel']-1 not in stations:
stations.insert(0,param['General']['active_trigger_channel']-1)
if len(tparam['channels']) != 1:
if param['General']['active_trigger_channel'] and param['General']['active_trigger_channel'] - 1 not in stations:
stations.insert(0, param['General']['active_trigger_channel'] - 1)
stations.sort()
event_nr = 0
event_nr_s = []
......@@ -107,9 +109,9 @@ def processing(param):
sta_total.merge(method=1, interpolation_samples=0)
if tparam['Gainrange']=='YAML':
for k in stations:
for k in range(0, len(sta_total.traces)):
sta_total.traces[k].data = sta_total.traces[k].data / 32768 * \
param['Acquisition']['hardware_settings']['gain_selection'][k]
param['Acquisition']['hardware_settings']['gain_selection'][stations[k]]
logger.info('Gain range trigger retrieved from YAML file')
logger.debug(sta_total)
......@@ -171,7 +173,7 @@ def processing(param):
flist = flist1[index_start_approved:]
new_files = [f for f in flist if f not in processed_files]
print(new_files)
#print(new_files)
if not len(new_files):
logger.info('Waiting for new files.')
time.sleep(1)
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