-
Notifications
You must be signed in to change notification settings - Fork 0
/
SiSpS.py
88 lines (77 loc) · 4.99 KB
/
SiSpS.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
import argparse
from Multi_Fixed_SimRunner import source_location_and_position_offset_changer_FixedMP
from Multi_Fixed_SimRunner import source_flux_and_position_offset_changer_FixedMP
from Multi_SimRunner import source_flux_and_position_offset_changer_parallel
from Multi_SimRunner import source_location_and_position_offset_changer_parallel
from SimRunner import source_flux_and_position_offset_changer as source_flux_and_position_offset_changer_serial
from SimRunner import moving_source_and_position_offset_changer as moving_source_and_position_offset_changer_serial
########################################################################
# Calls the simulation which varies position offsets and peak fluxes #
########################################################################
def main(output_folder,sim_type, fixed_array, multi_processing):
calibration_channel = [150e6]
sky_param = ['point_and_background', 200, 0.05, 0.]
noise_param = ['SEFD', 20e3, 40e3, 120]
beam_param = ['gaussian', 0.25, 0.25]
iterations = 999
peakflux_range = [50, 1.5e3, 49] #Specify in Jy
offset_range = [1e-2, 0.5, 51] #Specify in m
source_position_range = [0, 1, 388]
save_to_disk = [True, output_folder]
telescope_param = ["hex", 14., 0, 0]
#telescope_param = ["linear", 10, 5, 0]
calibration_scheme = 'full'
if sim_type == "changing_flux":
if multi_processing[0]:
if fixed_array:
source_flux_and_position_offset_changer_FixedMP(telescope_param, calibration_channel, noise_param,
sky_param, beam_param,
calibration_scheme, peakflux_range, offset_range,
iterations,
save_to_disk,
multi_processing[1])
else:
source_flux_and_position_offset_changer_parallel(telescope_param, calibration_channel, noise_param, sky_param,
beam_param, calibration_scheme, peakflux_range, offset_range,
iterations,
save_to_disk, multi_processing[1])
else:
source_flux_and_position_offset_changer_serial(telescope_param, calibration_channel, noise_param, sky_param,
beam_param, calibration_scheme, peakflux_range, offset_range,
iterations,
save_to_disk)
elif sim_type == "moving_source":
if multi_processing[0]:
if fixed_array:
source_location_and_position_offset_changer_FixedMP(telescope_param, calibration_channel, noise_param,
sky_param, beam_param,
calibration_scheme, source_position_range, offset_range,
iterations,
save_to_disk,
multi_processing[1])
else:
source_location_and_position_offset_changer_parallel(telescope_param, calibration_channel, noise_param, sky_param,
beam_param, calibration_scheme, source_position_range, offset_range,
iterations, save_to_disk, multi_processing[1])
else:
moving_source_and_position_offset_changer_serial(telescope_param, calibration_channel, noise_param, sky_param,
beam_param, calibration_scheme, source_position_range, offset_range,
iterations,save_to_disk)
else:
sys.exit("Wrong simulation choice....")
return
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Redundant \
Calibration Simulation set up')
parser.add_argument('-path', action='store',
default="/home/rjoseph/Bulk/Redundant_Calibration/Simulation_Output/"
"TEST0_SLPO_Hex_P_BG_full_FIX_half_range/",
type=str)
parser.add_argument('-sim_type', action='store', default="moving_source",
type=str)
parser.add_argument('-array_fix', action='store_true', default=False)
parser.add_argument('-MP', action='store_true', default=False,)
parser.add_argument('-MP_Processes', action='store', default=8,
type=int)
args = parser.parse_args()
main(args.path, args.sim_type, args.array_fix, [args.MP, args.MP_Processes])