-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateTable.py
More file actions
65 lines (61 loc) · 2.46 KB
/
createTable.py
File metadata and controls
65 lines (61 loc) · 2.46 KB
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
import numpy as np
import galaxy as g
import tool_analyze as ta
from prepare_data import *
f = open("data/table.txt", 'w')
f.write("{:15s}{:8s}{:7s}{:8s}{:9s}".format('Name', 'HubTyp', 'Bar', 'Q', 'X'))
f.write("{:10s}{:10s}{:10s}".format('sigma_z', 'M_stellar', 'M_dark'))
f.write("{:10}{:10s}".format('M_total', 'lambda_re'))
f.write("\n")
f.write("{:15s}{:8s}{:7s}{:8s}{:9s}".format('', '', '', '', ''))
f.write("{:10s}{:<10s}{:10s}".format('[km/s]', '[', 'log(M/M_sun)'))
f.write("{:>6s}{:10s}".format(']', ''))
f.write("\n")
hType = ta.get_type(gBar)
lambReBar = ta.read_lambda_re(gBar)
for i in range(len(gBar)):
G = g.Galaxy(gBar[i])
f.write("{:15s}".format(G.name))
f.write("{:8s}".format(hType[i]))
f.write("{:6s}".format(barredness[gBar[i]]))
f.write("{:6.3f}".format(Qbar_mean[i]))
f.write("{:8.3f}".format(Xbar_mean[i]))
f.write("{:10.3f}".format(sigZbar_mean[i]))
f.write("{:10.3f}".format(np.log10(G.get_stellar_mass())))
f.write("{:10.3f}".format(np.log10(G.get_dark_matter())))
f.write("{:10.3f}".format(
np.log10(G.get_stellar_mass()+G.get_dark_matter())))
f.write("{:10.3f}".format(lambReBar[i]))
f.write("\n")
hType = ta.get_type(gDisk)
lambReDisk = ta.read_lambda_re(gDisk)
for i in range(len(gDisk)):
G = g.Galaxy(gDisk[i])
f.write("{:15s}".format(G.name))
f.write("{:8s}".format(hType[i]))
f.write("{:6s}".format(barredness[gDisk[i]]))
f.write("{:6.3f}".format(Qdisk_mean[i]))
f.write("{:8.3f}".format(Xdisk_mean[i]))
f.write("{:10.3f}".format(sigZdisk_mean[i]))
f.write("{:10.3f}".format(np.log10(G.get_stellar_mass())))
f.write("{:10.3f}".format(np.log10(G.get_dark_matter())))
f.write("{:10.3f}".format(
np.log10(G.get_stellar_mass()+G.get_dark_matter())))
f.write("{:10.3f}".format(lambReDisk[i]))
f.write("\n")
hType = ta.get_type(gElli)
lambReElli = ta.read_lambda_re(gElli)
for i in range(len(gElli)):
G = g.Galaxy(gElli[i])
f.write("{:15s}".format(G.name))
f.write("{:8s}".format(hType[i]))
f.write("{:6s}".format(barredness[gElli[i]]))
f.write("{:6.3f}".format(Qelli_mean[i]))
f.write("{:8.3f}".format(Xelli_mean[i]))
f.write("{:10.3f}".format(sigZelli_mean[i]))
f.write("{:10.3f}".format(np.log10(G.get_stellar_mass())))
f.write("{:10.3f}".format(np.log10(G.get_dark_matter())))
f.write("{:10.3f}".format(
np.log10(G.get_stellar_mass()+G.get_dark_matter())))
f.write("{:10.3f}".format(lambReElli[i]))
f.write("\n")