-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparams_multi_object.py
92 lines (45 loc) · 1.92 KB
/
params_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
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
import glob
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
from scipy import stats
import scipy.optimize
from astropy import table
from astropy.io import ascii
import sys
from SF_functions import *
#Path to folder with the objects of interest
objects_path = "/home/idoi/Dropbox/superfit/multi_object/"
objects_list = glob.glob(objects_path+'*')
#Saving paths
save_bin_path = "/home/idoi/Dropbox/superfit/binned_files/"
save_results_path = "/home/idoi/Dropbox/superfit/results/"
show = False #show plots after optimization (if False, plots will still be saved as long as)
# Select a range and number of steps for z and A_v
z_num = 11
alam_num = 21
redshift = np.linspace(0,0.1,z_num)
#redshift = np.array([0.065712])
extconstant = np.linspace(-2,2,alam_num)
# Select a wavelength range and resolution
resolution = 20 #Angstrom
upper = 10500
lower = 3000
interval = int((upper - lower)/resolution)
lam = np.linspace(lower, upper, interval)
#Select template library
#Path where the binnings folder is, in order to pull the files from the library
path = "/home/idoi/Dropbox/superfit/"
templates_gal = glob.glob('binnings/'+ str(resolution) +'A/gal/*')
templates_gal = [x for x in templates_gal if 'CVS' not in x and 'README' not in x]
templates_gal = np.array(templates_gal)
templates_sn = glob.glob('binnings/' + str(resolution) + 'A/sne/**/*')
templates_sn = [x for x in templates_sn if 'CVS' not in x and 'README' not in x]
templates_sn = np.array(templates_sn)
#Select which parts of the library to look at
temp_gal_tr = ['/E','/S0','/Sa','/Sb','/SB1','/SB2','/SB3','/SB4','/SB5','/SB6','/Sc']
temp_sn_tr = ['/Ia/','/Ib/','/Ic/','/II/','/Others/']
templates_sn_trunc = select_templates(templates_sn, temp_sn_tr)
templates_gal_trunc = select_templates(templates_gal, temp_gal_tr)
#Select type of error spectrum
kind = 'SG'