Commit 2c4da0ab authored by doetschj's avatar doetschj
Browse files

change figure name and time to start processing

parent 071182c4
......@@ -41,7 +41,7 @@ General:
active_trigger_channel : 1
origin_ch1903_east : 579300.0 # ch1903 easting origin of local coordinate system
origin_ch1903_north : 247500.0 # ch1903 northing of local coordinate system
origin_elev : 500.0 # elevation of origin of local coordinate system
origin_elev : 500.0 # elevation of origin of local coordinate system
stats:
network : 'XB'
......@@ -79,12 +79,11 @@ Trigger:
spread_int : 1e-4
noise_vis : True
noise_vis_interval : 60 # in seconds
Hr : 13 #hour from which to start processing
Min : 49 #min from which to start processing
Time : 20190523_0406 #date and time from which to start processing
Processing:
parallel_processing: True
parallel_processing: False
number_workers : 5
vp : 2600.0 # velocity in m/s
vs : 2000.0 # velocity in m/s
......
......@@ -65,15 +65,18 @@ def processing(param):
# 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])>= int(str(tparam['Time'])[8:10]) and int(re.findall('\d+', f)[4]) >= int(str(tparam['Time'])[10:12]) and int(re.findall('\d+', f)[2]) >= int(str(tparam['Time'])[6:8]) and int(re.findall('\d+', f)[1]) >= int(str(tparam['Time'])[4:6]) and int(re.findall('\d+', f)[0]) >= int(str(tparam['Time'])[:4])]) #20190523_050033 generates a list of the .asdf files in asdf_folder
# if len(new_files):
# if int(re.findall('\d+', new_files[0])[3]) > int(str(tparam['Time'])[8:10]):
# new_files = new_files
# else:
# new_files = sorted([f for f in new_files if int(re.findall('\d+', f)[4]) >= int(str(tparam['Time'])[10:12])])
print(new_files)
new_files1 = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5')]) # generates a list of the .asdf files in asdf_folder
number2=[]
for j in range(len(new_files1)):
f = new_files1[j]
number = " "
for i in re.findall('\d+', f)[0:-3]:
number = number + i
number2.append(int(number))
condition=int(str(tparam['Time']).replace('_', ''))
number_approved = sorted(i for i in number2 if i >= condition )
index_start_approved=number2.index(number_approved[0])
new_files=new_files1[index_start_approved:]
processed_files = []
while 1:
......@@ -148,12 +151,19 @@ 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(re.findall('\d+', f)[3])>= int(str(tparam['Time'])[8:10]) and int(re.findall('\d+', f)[4]) >= int(str(tparam['Time'])[10:12]) and int(re.findall('\d+', f)[2]) >= int(str(tparam['Time'])[6:8]) and int(re.findall('\d+', f)[1]) >= int(str(tparam['Time'])[4:6]) and int(re.findall('\d+', f)[0]) >= int(str(tparam['Time'])[:4])])
# if len(flist):
# if int(re.findall('\d+', flist[0])[3]) > int(str(tparam['Time'])[8:10]):
# flist = flist
# else:
# flist = sorted([f for f in flist if int(re.findall('\d+', f)[4]) >= int(str(tparam['Time'])[10:12])])
flist1 = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5')]) # generates a list of the .asdf files in asdf_folder
number2 = []
for j in range(len(flist1)):
f = flist1[j]
number = " "
for i in re.findall('\d+', f)[0:-3]:
number = number + i
number2.append(int(number))
number_approved = sorted(i for i in number2 if i >= condition)
index_start_approved = number2.index(number_approved[0])
flist = flist1[index_start_approved:]
new_files = [f for f in flist if f not in processed_files]
print(new_files)
if not 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