-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_scripts.py
More file actions
93 lines (73 loc) · 2.76 KB
/
run_scripts.py
File metadata and controls
93 lines (73 loc) · 2.76 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wednesday Mar 16 16:49:10 2022
@author: irinastefanescu
"""
import os
import datetime
import globals
now = datetime.datetime.now()
print(' ')
print("Current date and time: ")
print(now.strftime("%Y-%m-%d %H:%M:%S \n"))
# print the number of EndCap sectors
print(' ')
print('Number of EndCap sectors considered in the calculation: ',
globals.no_modules)
# print the number of Mantle modules
print('Number of Mantle modules considered in the calculation: ',
globals.no_modulesM)
out_file = 'DREAMAll_voxels.txt'
tempM_file = 'Mantle_temp.txt'
tempF_file = 'Forward_temp.txt'
tempB_file = 'Backward_temp.txt'
tempHR_file = 'HR_temp.txt'
tempSANS_file = 'SANS_temp.txt'
try:
os.remove(out_file)
print(f"\nOld output file {out_file} removed.\n")
except FileNotFoundError:
print(f"Old file {out_file} not found. Creating it during this run.\n")
try:
os.remove(tempF_file)
print(f"\nOld output file {tempF_file} removed.\n")
except FileNotFoundError:
print(f"Old file {tempF_file} not found. Creating it during this run.\n")
try:
os.remove(tempM_file)
print(f"\nOld output file {tempM_file} removed.\n")
except FileNotFoundError:
print(f"Old file {tempM_file} not found. Creating it during this run.\n")
try:
os.remove(tempB_file)
print(f"\nOld output file {tempB_file} removed.\n")
except FileNotFoundError:
print(f"Old file {tempB_file} not found. Creating it during this run.\n")
try:
os.remove(tempHR_file)
print(f"\nOld output file {tempHR_file} removed.\n")
except FileNotFoundError:
print(f"Old file {tempHR_file} not found. Creating it during this run.\n")
try:
os.remove(tempSANS_file)
print(f"\nOld output file {tempSANS_file} removed.\n")
except FileNotFoundError:
print(f"Old file {tempSANS_file} not found. Creating it during this run.\n")
os.system(f'python DREAMMantle_calculate_voxels.py {tempM_file}')
print('Mantle done!\n')
os.system(f'python DREAMHR_calculate_voxels.py {tempHR_file}')
print('High-Resolution done!\n')
os.system(f'python DREAMSANS_calculate_voxels.py {tempSANS_file}')
print('SANS done!\n')
os.system('python DREAMSUMO3_calculate_voxels.py')
print('SUMO3 Backward & SUMO3 Forward done!\n')
os.system('python DREAMSUMO4_calculate_voxels.py')
print('SUMO4 Backward & SUMO4 Forward done!\n')
os.system('python DREAMSUMO5_calculate_voxels.py')
print('SUMO5 Backward & SUMO5 Forward done!\n')
os.system('python DREAMSUMO6_calculate_voxels.py')
print('SUMO6 Backward & SUMO6 Forward done!\n')
# os.system(f'cat {tempM_file} {tempHR_file} {tempB_file} {tempF_file} > {out_file}')
os.system(f'cat {tempM_file} {tempHR_file} {tempSANS_file} {tempB_file} {tempF_file} > {out_file}')
# os.system(f'cat {tempB_file} {tempF_file} > {out_file}')