-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_tcool_dist.py
322 lines (266 loc) · 13.7 KB
/
plot_tcool_dist.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
fid = np.genfromtxt("../original_sims/extracted_data/fid_tcool_mass_dist_CGM.txt")
cflow = np.genfromtxt("../original_sims/extracted_data/cflow_tcool_mass_dist_CGM.txt")
tctff5 = np.genfromtxt("../original_sims/extracted_data/tctff5_tcool_mass_dist_CGM.txt")
tctff20 = np.genfromtxt("../original_sims/extracted_data/tctff20_tcool_mass_dist_CGM.txt")
linrot = np.genfromtxt("../original_sims/extracted_data/linrot_tcool_mass_dist_CGM.txt")
norot = np.genfromtxt("../original_sims/extracted_data/norot_tcool_mass_dist_CGM.txt")
fid_disk = np.genfromtxt("../original_sims/extracted_data/fid_tcool_mass_dist_CGM-disk.txt")
cflow_disk = np.genfromtxt("../original_sims/extracted_data/cflow_tcool_mass_dist_CGM-disk.txt")
tctff5_disk = np.genfromtxt("../original_sims/extracted_data/tctff5_tcool_mass_dist_CGM-disk.txt")
tctff20_disk = np.genfromtxt("../original_sims/extracted_data/tctff20_tcool_mass_dist_CGM-disk.txt")
linrot_disk = np.genfromtxt("../original_sims/extracted_data/linrot_tcool_mass_dist_CGM-disk.txt")
norot_disk = np.genfromtxt("../original_sims/extracted_data/norot_tcool_mass_dist_CGM-disk.txt")
fig, ax = plt.subplots(nrows=3, ncols=5, sharex=True, sharey=True, figsize=(11,7))
ax[0,0].loglog(fid[:,0], np.cumsum(fid[:, 1]), c='C0', label='Fiducial')
ax[0,1].loglog(fid[:,0], np.cumsum(fid[:, 21]), c='C0')
ax[0,2].loglog(fid[:,0], np.cumsum(fid[:, 41]), c='C0')
ax[0,3].loglog(fid[:,0], np.cumsum(fid[:, 61]), c='C0')
ax[0,4].loglog(fid[:,0], np.cumsum(fid[:, 81]), c='C0', label='Fiducial')
ax[0,0].loglog(fid_disk[:,0], np.cumsum(fid_disk[:,1]), c='C0', ls='--')
ax[0,1].loglog(fid_disk[:,0], np.cumsum(fid_disk[:,2]), c='C0', ls='--')
ax[0,2].loglog(fid_disk[:,0], np.cumsum(fid_disk[:,3]), c='C0', ls='--')
ax[0,3].loglog(fid_disk[:,0], np.cumsum(fid_disk[:,4]), c='C0', ls='--')
ax[0,4].loglog(fid_disk[:,0], np.cumsum(fid_disk[:,5]), c='C0', ls='--')
ax[0,0].loglog(cflow[:,0], np.cumsum(cflow[:, 1]), c='C3', label='Cooling Flow')
ax[0,1].loglog(cflow[:,0], np.cumsum(cflow[:, 21]), c='C3')
ax[0,2].loglog(cflow[:,0], np.cumsum(cflow[:, 41]), c='C3')
ax[0,3].loglog(cflow[:,0], np.cumsum(cflow[:, 61]), c='C3')
ax[0,4].loglog(cflow[:,0], np.cumsum(cflow[:, 81]), c='C3', label='Cooling Flow')
ax[0,0].loglog(cflow_disk[:,0], np.cumsum(cflow_disk[:,1]), c='C3', ls='--')
ax[0,1].loglog(cflow_disk[:,0], np.cumsum(cflow_disk[:,2]), c='C3', ls='--')
ax[0,2].loglog(cflow_disk[:,0], np.cumsum(cflow_disk[:,3]), c='C3', ls='--')
ax[0,3].loglog(cflow_disk[:,0], np.cumsum(cflow_disk[:,4]), c='C3', ls='--')
ax[0,4].loglog(cflow_disk[:,0], np.cumsum(cflow_disk[:,5]), c='C3', ls='--')
ax[0,0].legend(loc='lower right', framealpha=1)
ax[1,0].loglog(fid[:,0], np.cumsum(fid[:, 1]), c='C0')
ax[1,1].loglog(fid[:,0], np.cumsum(fid[:, 21]), c='C0')
ax[1,2].loglog(fid[:,0], np.cumsum(fid[:, 41]), c='C0')
ax[1,3].loglog(fid[:,0], np.cumsum(fid[:, 61]), c='C0')
ax[1,4].loglog(fid[:,0], np.cumsum(fid[:, 81]), c='C0')
ax[1,0].loglog(tctff5[:,0], np.cumsum(tctff5[:, 1]), c='C2', label=r'$t_{\rm c}/t_{\rm ff}=5$')
ax[1,1].loglog(tctff5[:,0], np.cumsum(tctff5[:, 21]), c='C2')
ax[1,2].loglog(tctff5[:,0], np.cumsum(tctff5[:, 41]), c='C2')
ax[1,3].loglog(tctff5[:,0], np.cumsum(tctff5[:, 61]), c='C2')
ax[1,4].loglog(tctff5[:,0], np.cumsum(tctff5[:, 81]), c='C2', label=r'$t_{\rm c}/t_{\rm ff}=5$')
ax[1,0].loglog(tctff5_disk[:,0], np.cumsum(tctff5_disk[:,1]), c='C2', ls='--')
ax[1,1].loglog(tctff5_disk[:,0], np.cumsum(tctff5_disk[:,2]), c='C2', ls='--')
ax[1,2].loglog(tctff5_disk[:,0], np.cumsum(tctff5_disk[:,3]), c='C2', ls='--')
ax[1,3].loglog(tctff5_disk[:,0], np.cumsum(tctff5_disk[:,4]), c='C2', ls='--')
ax[1,4].loglog(tctff5_disk[:,0], np.cumsum(tctff5_disk[:,5]), c='C2', ls='--')
ax[1,0].loglog(tctff20[:,0], np.cumsum(tctff20[:, 1]), c='C1', label=r'$t_{\rm c}/t_{\rm ff}=20$')
ax[1,1].loglog(tctff20[:,0], np.cumsum(tctff20[:, 21]), c='C1')
ax[1,2].loglog(tctff20[:,0], np.cumsum(tctff20[:, 41]), c='C1')
ax[1,3].loglog(tctff20[:,0], np.cumsum(tctff20[:, 61]), c='C1')
ax[1,4].loglog(tctff20[:,0], np.cumsum(tctff20[:, 81]), c='C1', label=r'$t_{\rm c}/t_{\rm ff}=20$')
ax[1,0].loglog(tctff20_disk[:,0], np.cumsum(tctff20_disk[:,1]), c='C1', ls='--')
ax[1,1].loglog(tctff20_disk[:,0], np.cumsum(tctff20_disk[:,2]), c='C1', ls='--')
ax[1,2].loglog(tctff20_disk[:,0], np.cumsum(tctff20_disk[:,3]), c='C1', ls='--')
ax[1,3].loglog(tctff20_disk[:,0], np.cumsum(tctff20_disk[:,4]), c='C1', ls='--')
ax[1,4].loglog(tctff20_disk[:,0], np.cumsum(tctff20_disk[:,5]), c='C1', ls='--')
ax[1,0].legend(loc='lower right', framealpha=1)
ax[2,0].loglog(fid[:,0], np.cumsum(fid[:, 1]), c='C0')
ax[2,1].loglog(fid[:,0], np.cumsum(fid[:, 21]), c='C0')
ax[2,2].loglog(fid[:,0], np.cumsum(fid[:, 41]), c='C0')
ax[2,3].loglog(fid[:,0], np.cumsum(fid[:, 61]), c='C0')
ax[2,4].loglog(fid[:,0], np.cumsum(fid[:, 81]), c='C0')
ax[2,0].loglog(linrot[:,0], np.cumsum(linrot[:, 1]), c='C4', label='Linear Rot')
ax[2,1].loglog(linrot[:,0], np.cumsum(linrot[:, 21]), c='C4')
ax[2,2].loglog(linrot[:,0], np.cumsum(linrot[:, 41]), c='C4')
ax[2,3].loglog(linrot[:,0], np.cumsum(linrot[:, 61]), c='C4')
ax[2,4].loglog(linrot[:,0], np.cumsum(linrot[:, 81]), c='C4', label='Linear Rot')
ax[2,0].loglog(linrot_disk[:,0], np.cumsum(linrot_disk[:,1]), c='C4', ls='--')
ax[2,1].loglog(linrot_disk[:,0], np.cumsum(linrot_disk[:,2]), c='C4', ls='--')
ax[2,2].loglog(linrot_disk[:,0], np.cumsum(linrot_disk[:,3]), c='C4', ls='--')
ax[2,3].loglog(linrot_disk[:,0], np.cumsum(linrot_disk[:,4]), c='C4', ls='--')
ax[2,4].loglog(linrot_disk[:,0], np.cumsum(linrot_disk[:,5]), c='C4', ls='--')
ax[2,0].loglog(norot[:,0], np.cumsum(norot[:, 1]), c='C5', label='No Rot')
ax[2,1].loglog(norot[:,0], np.cumsum(norot[:, 21]), c='C5')
ax[2,2].loglog(norot[:,0], np.cumsum(norot[:, 41]), c='C5')
ax[2,3].loglog(norot[:,0], np.cumsum(norot[:, 61]), c='C5')
ax[2,4].loglog(norot[:,0], np.cumsum(norot[:, 81]), c='C5', label='No Rot')
ax[2,0].loglog(norot_disk[:,0], np.cumsum(norot_disk[:,1]), c='C5', ls='--')
ax[2,1].loglog(norot_disk[:,0], np.cumsum(norot_disk[:,2]), c='C5', ls='--')
ax[2,2].loglog(norot_disk[:,0], np.cumsum(norot_disk[:,3]), c='C5', ls='--')
ax[2,3].loglog(norot_disk[:,0], np.cumsum(norot_disk[:,4]), c='C5', ls='--')
ax[2,4].loglog(norot_disk[:,0], np.cumsum(norot_disk[:,5]), c='C5', ls='--')
ax[2,0].legend(loc='lower right', framealpha=1)
ax[0,0].set_title('0 Gyr', fontweight='bold')
ax[0,1].set_title('1 Gyr', fontweight='bold')
ax[0,2].set_title('2 Gyr', fontweight='bold')
ax[0,3].set_title('3 Gyr', fontweight='bold')
ax[0,4].set_title('4 Gyr', fontweight='bold')
cgm = Line2D([0], [0], ls='-', c='dimgray')
w_disk = Line2D([0], [0], ls='--', c='dimgray')
ax[0,1].legend([cgm, w_disk], ["CGM Only","CGM + Disk"])
#ax[0,0].set_xlim(1e-5, 1e1)
ax[0,0].set_xlim(1e-1, 1e2)
for i in range(3):
ax[i,0].set_ylabel(r"$M(t_{\rm c} < t_{\rm c,0})\ \mathrm{[M_\odot]}$", fontsize='large')
# for j in range(5):
# ax[i,j].grid()
# ax[i,j].axvline(1, c='gray', ls='--')
# ax[i,j].axvline(10, c='gray', ls='--')
for i in range(5):
ax[2,i].set_xlabel(r"$t_{\rm c,0}$ [Gyr]", fontsize='large')
ax[0,0].set_ylim(1e7, 1e11)
#ax[0,0].yaxis.set_major_locator(FixedLocator([1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10]))
#ax[0,0].set_xticks([1e-5,1e-4,1e-3,1e-2,1e-1,1e0,1e1])
#ax[0,0].set_xticks([1e-2,1e-1,1e0,1e1,1e2,1e3,1e4,1e5])
#ax[0,0].set_xticklabels(['$10^{-2}$','','$10^{0}$','','$10^{2}$','','$10^4$',''])
for i in range(3):
for j in range(5):
ax[i,j].grid(axis='both')
fig.tight_layout()
fig.savefig("../original_sims/figures/fig_tcool-mass-dist_cumm-big.pdf")
fig, ax = plt.subplots(nrows=3, ncols=2, sharex=True, sharey=True, figsize=(5,5))
lb = 26
ub = -20
ax[0,0].loglog(fid[:,0],
np.cumsum(fid[:, 1])/np.cumsum(fid[:, 1])[-1],
c='C0', label='Fid')
ax[0,1].loglog(fid[:,0],
np.cumsum(fid[:, 21])/np.cumsum(fid[:, 21])[-1],
c='C0', label='Fid')
ax[1,0].loglog(fid[:,0],
np.cumsum(fid[:, 41])/np.cumsum(fid[:, 41])[-1],
c='C0')
ax[1,1].loglog(fid[:,0],
np.cumsum(fid[:, 61])/np.cumsum(fid[:, 61])[-1],
c='C0')
ax[2,0].loglog(fid[:,0],
np.cumsum(fid[:, 81])/np.cumsum(fid[:, 81])[-1],
c='C0')
ax[0,0].loglog(tctff5[:,0],
np.cumsum(tctff5[:, 1]) / np.cumsum(tctff5[:, 1])[-1],
c='C2', label='LowRatio')
ax[0,1].loglog(tctff5[:,0],
np.cumsum(tctff5[:, 21]) / np.cumsum(tctff5[:, 21])[-1],
c='C2', label='LowRatio')
ax[1,0].loglog(tctff5[:,0],
np.cumsum(tctff5[:, 41]) / np.cumsum(tctff5[:, 41])[-1],
c='C2')
ax[1,1].loglog(tctff5[:,0],
np.cumsum(tctff5[:, 61]) / np.cumsum(tctff5[:, 61])[-1],
c='C2')
ax[2,0].loglog(tctff5[:,0],
np.cumsum(tctff5[:, 81]) / np.cumsum(tctff5[:, 81])[-1],
c='C2')
ax[0,0].loglog(tctff20[:,0],
np.cumsum(tctff20[:, 1]) / np.cumsum(tctff20[:, 1])[-1],
c='C1', label='HighRatio')
ax[0,1].loglog(tctff20[:,0],
np.cumsum(tctff20[:, 21]) / np.cumsum(tctff20[:, 21])[-1],
c='C1', label='HighRatio')
ax[1,0].loglog(tctff20[:,0],
np.cumsum(tctff20[:, 41]) / np.cumsum(tctff20[:, 41])[-1],
c='C1')
ax[1,1].loglog(tctff20[:,0],
np.cumsum(tctff20[:, 61]) / np.cumsum(tctff20[:, 61])[-1],
c='C1')
ax[2,0].loglog(tctff20[:,0],
np.cumsum(tctff20[:, 81]) / np.cumsum(tctff20[:, 81])[-1],
c='C1')
ax[0,1].legend(framealpha=1)
ax[0,0].text(0.05, 0.9, '0 Gyr', transform=ax[0,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[0,1].text(0.05, 0.9, '1 Gyr', transform=ax[0,1].transAxes, fontweight='bold',
ha='left', va='top')
ax[1,0].text(0.05, 0.9, '2 Gyr', transform=ax[1,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[1,1].text(0.05, 0.9, '3 Gyr', transform=ax[1,1].transAxes, fontweight='bold',
ha='left', va='top')
ax[2,0].text(0.05, 0.9, '4 Gyr', transform=ax[2,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[0,0].set_xlim(1e-1, 1e2)
ax[0,0].set_ylim(1e-3,1.5e0)
for i in range(2):
ax[i,0].set_ylabel(r"Mass PDF", fontsize='large')
for j in range(2):
ax[i,j].grid()
ax[2,0].grid()
ax[2,1].set_axis_off()
ax[1,1].tick_params(labelbottom=True)
ax[2,0].set_ylabel(r"Mass PDF", fontsize='large')
ax[2,0].set_xlabel(r"$t_{\rm c,0}$ [Gyr]", fontsize='large')
ax[1,1].set_xlabel(r"$t_{\rm c,0}$ [Gyr]", fontsize='large')
fig.tight_layout()
fig.subplots_adjust(hspace=0.1)
fig.savefig("../original_sims/figures/fig_tcool-mass-dist_tctff-var.pdf")
fig, ax = plt.subplots(nrows=3, ncols=2, sharex=True, sharey=True, figsize=(5,5))
lb = 26
ub = -20
ax[0,0].loglog(fid[:,0],
np.cumsum(fid[:, 1])/np.cumsum(fid[:, 1])[-1],
c='C0', label='Fid')
ax[0,1].loglog(fid[:,0],
np.cumsum(fid[:, 21])/np.cumsum(fid[:, 21])[-1],
c='C0', label='Fid')
ax[1,0].loglog(fid[:,0],
np.cumsum(fid[:, 41])/np.cumsum(fid[:, 41])[-1],
c='C0')
ax[1,1].loglog(fid[:,0],
np.cumsum(fid[:, 61])/np.cumsum(fid[:, 61])[-1],
c='C0')
ax[2,0].loglog(fid[:,0],
np.cumsum(fid[:, 81])/np.cumsum(fid[:, 81])[-1],
c='C0')
ax[0,0].loglog(linrot[:,0],
np.cumsum(linrot[:, 1]) / np.cumsum(linrot[:, 1])[-1],
c='C4', label='LinRot')
ax[0,1].loglog(linrot[:,0],
np.cumsum(linrot[:, 21]) / np.cumsum(linrot[:, 21])[-1],
c='C4', label='LinRot')
ax[1,0].loglog(linrot[:,0],
np.cumsum(linrot[:, 41]) / np.cumsum(linrot[:, 41])[-1],
c='C4')
ax[1,1].loglog(linrot[:,0],
np.cumsum(linrot[:, 61]) / np.cumsum(linrot[:, 61])[-1],
c='C4')
ax[2,0].loglog(linrot[:,0],
np.cumsum(linrot[:, 81]) / np.cumsum(linrot[:, 81])[-1],
c='C4')
ax[0,0].loglog(norot[:,0],
np.cumsum(norot[:, 1]) / np.cumsum(norot[:, 1])[-1],
c='C5', label='NoRot')
ax[0,1].loglog(norot[:,0],
np.cumsum(norot[:, 21]) / np.cumsum(norot[:, 21])[-1],
c='C5', label='NoRot')
ax[1,0].loglog(norot[:,0],
np.cumsum(norot[:, 41]) / np.cumsum(norot[:, 41])[-1],
c='C5')
ax[1,1].loglog(norot[:,0],
np.cumsum(norot[:, 61]) / np.cumsum(norot[:, 61])[-1],
c='C5')
ax[2,0].loglog(norot[:,0],
np.cumsum(norot[:, 81]) / np.cumsum(norot[:, 81])[-1],
c='C5')
ax[0,1].legend(framealpha=1)
ax[0,0].text(0.05, 0.9, '0 Gyr', transform=ax[0,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[0,1].text(0.05, 0.9, '1 Gyr', transform=ax[0,1].transAxes, fontweight='bold',
ha='left', va='top')
ax[1,0].text(0.05, 0.9, '2 Gyr', transform=ax[1,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[1,1].text(0.05, 0.9, '3 Gyr', transform=ax[1,1].transAxes, fontweight='bold',
ha='left', va='top')
ax[2,0].text(0.05, 0.9, '4 Gyr', transform=ax[2,0].transAxes, fontweight='bold',
ha='left', va='top')
ax[0,0].set_xlim(1e-1, 1e2)
ax[0,0].set_ylim(1e-3,1.5e0)
for i in range(2):
ax[i,0].set_ylabel(r"Mass PDF", fontsize='large')
for j in range(2):
ax[i,j].grid()
ax[2,0].grid()
ax[2,1].set_axis_off()
ax[1,1].tick_params(labelbottom=True)
ax[2,0].set_ylabel(r"Mass PDF", fontsize='large')
ax[2,0].set_xlabel(r"$t_{\rm c,0}$ [Gyr]", fontsize='large')
ax[1,1].set_xlabel(r"$t_{\rm c,0}$ [Gyr]", fontsize='large')
fig.tight_layout()
fig.subplots_adjust(hspace=0.1)
fig.savefig("../original_sims/figures/fig_tcool-mass-dist_rot-var.pdf")