-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_LSST_emu8.py
178 lines (169 loc) · 7.15 KB
/
plot_LSST_emu8.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
import getdist.plots as gplot
from getdist import MCSamples
from getdist import loadMCSamples
import os
import matplotlib
import subprocess
import matplotlib.pyplot as plt
import numpy as np
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
# GENERAL PLOT OPTIONS
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'
matplotlib.rcParams['mathtext.rm'] = 'Bitstream Vera Sans'
matplotlib.rcParams['mathtext.it'] = 'Bitstream Vera Sans:italic'
matplotlib.rcParams['mathtext.bf'] = 'Bitstream Vera Sans:bold'
matplotlib.rcParams['xtick.bottom'] = True
matplotlib.rcParams['xtick.top'] = False
matplotlib.rcParams['ytick.right'] = False
matplotlib.rcParams['axes.edgecolor'] = 'black'
matplotlib.rcParams['axes.linewidth'] = '1.0'
matplotlib.rcParams['axes.labelsize'] = 'medium'
matplotlib.rcParams['axes.grid'] = True
matplotlib.rcParams['grid.linewidth'] = '0.0'
matplotlib.rcParams['grid.alpha'] = '0.18'
matplotlib.rcParams['grid.color'] = 'lightgray'
matplotlib.rcParams['legend.labelspacing'] = 0.77
matplotlib.rcParams['savefig.bbox'] = 'tight'
matplotlib.rcParams['savefig.format'] = 'pdf'
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
analysissettings0={'ignore_rows': u'0.1'}
analysissettings={
'smooth_scale_2D':0.5,
'smooth_scale_1D': 0.5,
'fine_bins_2D': u'1000',
'fine_bins': u'1000',
'num_bins_2D': u'1000',
'num_bins': u'1000',
'range_confidence' : u'0.025',
'ignore_rows': u'0.0'
}
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
zpivot=0.4
samples=loadMCSamples('./LSST_3x2pt_sys_model_23',settings=analysissettings0)
p = samples.getParams()
samples.addDerived(1e9*p.sigma8,name='AA',label='10^9 A_\mathrm{s}',
range=[samples.getLower('sigma8')*1e9,samples.getUpper('sigma8')*1e9])
samples.addDerived(100*p.h0,name='H0',label='H_0',
range=[samples.getLower('h0')*1e2,samples.getUpper('h0')*1e2])
samples.addDerived(10*p.ns,name='ns10',label='10 n_s',
range=[10*samples.getLower('ns'),10*samples.getUpper('ns')])
samples.addDerived(100*p.omegab,name='omegab100',label='100 \Omega_b',
range=[100*samples.getLower('omegab'),100*samples.getUpper('omegab')])
samples.addDerived(10*p.omegam,name='omegam10',label='10 \Omega_m',
range=[10*samples.getLower('omegam'),10*samples.getUpper('omegam')])
samples.addDerived(p.w0+(zpivot/(1.+zpivot))*p.wa,name='wp',label='w_p',
range=[samples.getLower('w0')+(zpivot/(1.+zpivot))*samples.getLower('wa'),samples.getUpper('w0')+(zpivot/(1.+zpivot))*samples.getUpper('wa')])
samples.saveAsText('.VM_plot_all_probes_multi_v2_TMP_1')
samples=loadMCSamples('./LSST_3x2pt_sys_model_24',settings=analysissettings0)
p = samples.getParams()
samples.addDerived(1e9*p.sigma8,name='AA',label='10^9 A_\mathrm{s}',
range=[samples.getLower('sigma8')*1e9,samples.getUpper('sigma8')*1e9])
samples.addDerived(100*p.h0,name='H0',label='H_0',
range=[samples.getLower('h0')*1e2,samples.getUpper('h0')*1e2])
samples.addDerived(10*p.ns,name='ns10',label='10 n_s',
range=[10*samples.getLower('ns'),10*samples.getUpper('ns')])
samples.addDerived(100*p.omegab,name='omegab100',label='100 \Omega_b',
range=[100*samples.getLower('omegab'),100*samples.getUpper('omegab')])
samples.addDerived(10*p.omegam,name='omegam10',label='10 \Omega_m',
range=[10*samples.getLower('omegam'),10*samples.getUpper('omegam')])
samples.addDerived(p.w0+(zpivot/(1.+zpivot))*p.wa,name='wp',label='w_p',
range=[samples.getLower('w0')+(zpivot/(1.+zpivot))*samples.getLower('wa'),samples.getUpper('w0')+(zpivot/(1.+zpivot))*samples.getUpper('wa')])
samples.saveAsText('.VM_plot_all_probes_multi_v2_TMP_2')
samples=loadMCSamples('./LSST_3x2pt_sys_model_24',settings=analysissettings0)
p = samples.getParams()
samples.addDerived(1e9*p.sigma8,name='AA',label='10^9 A_\mathrm{s}',
range=[samples.getLower('sigma8')*1e9,samples.getUpper('sigma8')*1e9])
samples.addDerived(100*p.h0,name='H0',label='H_0',
range=[samples.getLower('h0')*1e2,samples.getUpper('h0')*1e2])
samples.addDerived(10*p.ns,name='ns10',label='10 n_s',
range=[10*samples.getLower('ns'),10*samples.getUpper('ns')])
samples.addDerived(100*p.omegab,name='omegab100',label='100 \Omega_b',
range=[100*samples.getLower('omegab'),100*samples.getUpper('omegab')])
samples.addDerived(10*p.omegam,name='omegam10',label='10 \Omega_m',
range=[10*samples.getLower('omegam'),10*samples.getUpper('omegam')])
samples.addDerived(p.w0+(zpivot/(1.+zpivot))*p.wa,name='wp',label='w_p',
range=[samples.getLower('w0')+(zpivot/(1.+zpivot))*samples.getLower('wa'),samples.getUpper('w0')+(zpivot/(1.+zpivot))*samples.getUpper('wa')])
samples.saveAsText('.VM_plot_all_probes_multi_v2_TMP_3')
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
g=gplot.getSinglePlotter(
chain_dir=r'./',
analysis_settings=analysissettings,
width_inch=4.5
)
g.settings.lw_contour = 1.0
g.settings.legend_rect_border = False
g.settings.figure_legend_frame = False
g.settings.axes_fontsize = 15.5
g.settings.legend_fontsize = 10.0
g.settings.alpha_filled_add = 0.7
g.settings.lab_fontsize=20
g.legend_labels=False
roots = [
'.VM_plot_all_probes_multi_v2_TMP_1',
'.VM_plot_all_probes_multi_v2_TMP_2',
'.VM_plot_all_probes_multi_v2_TMP_3',
]
params = [['wp','wa']]
g.plots_2d(
roots,
param_pairs=params,
filled=True,
imax_shaded=2,
line_args=[
{'lw': 1.4,'ls': 'solid', 'color':'lightskyblue'},
{'lw': 1.0,'ls': 'solid', 'color':'maroon'},
{'lw': 1.0,'ls': 'solid', 'color':'black'}
],
contour_colors=[
'lightskyblue',
'maroon',
'black',
]
,lims=[-2.,-0.,-2.5,2.5]
)
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
# FINISH PLOT SETUP
g.settings.tight_layout=True
g.finish_plot(
legend_labels=[
'model 23',
'model 24',
'model 24',
],
no_extra_legend_space=True,
legend_loc=(0.60,0.76)
)
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
g.export()
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------
#DELETE TMP FILES
subprocess.Popen(
"rm .VM_plot_all_probes_multi_v2_TMP_[0-9].*",
shell=True,
cwd="."
)
### ------------------------------------------------
### ------------------------------------------------
### ------------------------------------------------