Commit 4c2e7104 authored by Semih Demir's avatar Semih Demir
Browse files

small changes in merge and processing

parent e1cd0997
......@@ -59,7 +59,7 @@ def merge(param):
sta.write(merge_folder + '/' + gparam['project_name'] + str(start_time) + ".mseed")
new_file = pyasdf.ASDFDataSet(merge_folder + '/' + gparam['project_name'] + str(start_time) + ".h5",
new_file = pyasdf.ASDFDataSet(merge_folder + '/' + str(start_time) + '_'+ gparam['project_name'] + ".h5",
compression="gzip-3")
files = glob.glob(merge_folder + '/' + gparam['project_name'] + str(start_time) + ".mseed")
......
......@@ -18,6 +18,7 @@ import time
import pyasdf
from dug_seis.processing.dug_trigger import dug_trigger
from dug_seis.processing.event_processing import event_processing
import re
def processing(param):
......@@ -48,7 +49,13 @@ def processing(param):
# load list of ASDF snippets in folder
sta_overlap = Stream()
new_files = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5') and int(f[11:13])>=tparam['Hr'] and int(f[14:16])>=tparam['Min']]) # generates a list of the .asdf files in asdf_folder
# re.findall('\d+', 'xyz123abc456def789')
# koek=[int(re.findall('\d+', f)[4]) for f in os.listdir(asdf_folder) if f.endswith('.h5')]
# print(koek)
# if tparam['processing time'] == True:
new_files = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5') and int(re.findall('\d+', f)[3])>= tparam['Hr'] and int(re.findall('\d+', f)[4])>=tparam['Min']]) # generates a list of the .asdf files in asdf_folder
# int(f[11:13]) >= tparam['Hr']
processed_files = []
while 1:
......@@ -109,7 +116,7 @@ def processing(param):
processed_files.append(current_file)
else:
flist = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5') and int(f[11:13])>=tparam['Hr'] and int(f[14:16])>=tparam['Min']])
flist = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5') and int(re.findall('\d+', f)[3])>= tparam['Hr'] and int(re.findall('\d+', f)[4])>=tparam['Min']])
new_files = [f for f in flist if f not in processed_files]
if not len(new_files):
logging.info('Waiting for 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