-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_params_file_muse.py
executable file
·44 lines (32 loc) · 1.25 KB
/
create_params_file_muse.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
import numpy as np
from checkcomp import checkcomp
cc = checkcomp()
opt = 'pop_no_Na' # must contain kin or pop
galaxies = ['ic1459', 'ic4296', 'ngc1316', 'ngc1399']
gals=[2]
output_file = "%s/MUSE_project/analysis/params_muse.txt" % (cc.home_dir)
f = open(output_file, 'w')
for gal in gals:
galaxy = galaxies[gal]
tessellation_File = '%s/Data/muse/analysis/%s/%s/' % (cc.base_dir, galaxy, opt) + \
'setup/voronoi_2d_binning_output.txt'
bin_num = np.loadtxt(tessellation_File, usecols=(2,), skiprows=1, unpack=True)
n_bins = int(max(bin_num)+1)
for i in range(n_bins):
f.write("python errors2_muse.py " + str(gal) + " " + opt + " " + str(i) +
"\n")
f.write("push.sh 'Glamdring MUSE finished %s'\n"%(galaxy))
if 'pop' in opt:
for gal in gals:
galaxy = galaxies[gal]
tessellation_File = '%s/Data/muse/analysis/%s/%s/' % (cc.base_dir, galaxy, opt) + \
'setup/voronoi_2d_binning_output.txt'
bin_num = np.loadtxt(tessellation_File, usecols=(2,), skiprows=1, unpack=True)
n_bins = int(max(bin_num)+1)
for i in range(n_bins):
# if 'kin' in opt:
f.write("python pop.py muse " + str(gal) + " " + opt + " " + str(i) +
"\n")
f.write("push.sh 'Glamdring MUSE run finished'")
f.close()
print "Done"