-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathregen.py
42 lines (31 loc) · 1.06 KB
/
regen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from generate_images import infrasound_location
from obspy import UTCDateTime
from web import config
from concurrent.futures import ProcessPoolExecutor
def runDate(RUN_END):
missed = []
generator = infrasound_location(RUN_END)
for volc_name, volc_info in config.VOLCS.items():
try:
generator.gen_volc_image(volc_name, volc_info, False)
except Exception as e:
print(e)
missed.append(RUN_END)
pass
return missed
if __name__ == "__main__":
missed = []
futures = []
# 2022-11-24T03:00:00.000000Z
START = UTCDateTime(2023, 2, 12, 0, 0, 0)
STOP = UTCDateTime(2023, 2, 13, 0, 0, 0)
RUN_END = START
with ProcessPoolExecutor(max_workers = 5, max_tasks_per_child=1) as executor:
while RUN_END <= STOP:
future = executor.submit(runDate, RUN_END)
#runDate(RUN_END)
RUN_END = RUN_END + (10 * 60)
for future in futures:
missed += future.result()
print("****************RUN COMPLETE**************")
# print(missed)