-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_multi_object.py
38 lines (15 loc) · 1.02 KB
/
run_multi_object.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
from SF_functions import *
from Header_Binnings import *
from params_multi_object import *
for original in objects_list:
try:
binned_name= obj_name_int(original, lam, resolution)[3]
print('Running optimization for spectrum file: {0}'.format(binned_name))
#Obtaining the binned file name (obj to be analyzed)
save_bin = save_bin_path + binned_name
#Calling the original file, getting rid of the header and binning it (default set to 20A)
kill_header_and_bin(original,resolution, save_bin = save_bin)
#Core superfit function on the binned file, default to plot and save n fits
all_parameter_space(redshift,extconstant,templates_sn_trunc,templates_gal_trunc, lam, resolution, n=2, plot=1, kind=kind, original=save_bin, path=path, save=save_results_path, show=show)
except:
print('An error has occured when trying to optimize for spectrum file {0}. Inspect input spectrum and parameters. Proceeding to next spectrum file'.format(binned_name))