-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_simulation.py
104 lines (91 loc) · 2.96 KB
/
run_simulation.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
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
94
95
96
97
98
99
100
101
102
103
104
from run_lwa_jobs_celery import (
run_simulation_celery,
run_calibration_celery,
test_function,
)
import multiprocessing
def run_compact_source_sims_Aug5():
use_filenames = [
"18",
"23",
"27",
"36",
"41",
"46",
"50",
"55",
"59",
"64",
"73",
"78",
"82",
]
use_celery = False
parallel = False
if use_celery:
for file_name in use_filenames[::-1]:
run_simulation_celery.delay(
f"/lustre/rbyrne/skymodels/Gasperin2020_sources_plus_{file_name}.skyh5",
"/lustre/rbyrne/LWA_10to100_MROsoil_efields.fits",
f"/lustre/gh/2024-03-02/calibration/ruby/{file_name}.ms",
f"/lustre/rbyrne/2024-03-02/calibration_models/{file_name}_deGasperin_sources.uvfits",
)
elif parallel:
pool = multiprocessing.Pool(processes=len(use_filenames))
args_list = []
for file_name in use_filenames:
args = (
f"/lustre/rbyrne/skymodels/Gasperin2020_sources_plus_{file_name}.skyh5",
"/lustre/rbyrne/LWA_10to100_MROsoil_efields.fits",
f"/lustre/gh/2024-03-02/calibration/ruby/{file_name}.ms",
f"/lustre/rbyrne/2024-03-02/calibration_models/{file_name}_deGasperin_sources.uvfits",
)
args_list.append(args)
pool.starmap(
run_simulation_celery,
args_list,
)
pool.close()
pool.join()
else:
for file_name in use_filenames[::-1]:
run_simulation_celery(
f"/lustre/rbyrne/skymodels/Gasperin2020_sources_plus_{file_name}.skyh5",
"/lustre/rbyrne/LWA_10to100_MROsoil_efields.fits",
f"/lustre/gh/2024-03-02/calibration/ruby/{file_name}.ms",
f"/lustre/rbyrne/2024-03-02/calibration_models/{file_name}_deGasperin_sources.uvfits",
)
def run_calibration_Aug7():
use_filenames = [
"18",
"23",
"27",
"36",
"41",
"46",
"50",
"55",
"59",
"64",
"73",
"78",
# "82",
]
for file_name in use_filenames:
datafile = f"/lustre/gh/2024-03-02/calibration/ruby/{file_name}.ms"
model_file = f"/lustre/rbyrne/2024-03-02/calibration_models/{file_name}_deGasperin_sources.ms"
run_calibration_celery(
datafile,
model_file,
"DATA",
"DATA",
True,
10,
125,
False,
f"/lustre/rbyrne/2024-03-02/calibration_outputs/{file_name}_extended_sources_cal_log.txt",
f"/lustre/rbyrne/2024-03-02/calibration_outputs/{file_name}_extended_sources.calfits",
f"/lustre/rbyrne/2024-03-02/calibration_outputs/{file_name}_calibrated_extended_sources.ms",
)
if __name__ == "__main__":
run_compact_source_sims_Aug5()