9
9
(https://ui.adsabs.harvard.edu/abs/2012ApJ...758...75B/abstract), referred to
10
10
as BBPS.
11
11
12
- Their best-fit pressure profile is implemented in the function
12
+ Their best-fit 3D pressure profile is implemented in the function
13
13
`P_BBPS`, and projected profiles are implemented in `projected_P_BBPS` and
14
- `projected_P_BBPS_real`. The difference in the latter is that `projected_P_BBPS`
15
- makes an approximation that reduces cosmology dependence, and
16
- `projected_P_BBPS_real` interpolates over a table of comoving distances to
17
- obtain a more precise answer.
14
+ `projected_y_BBPS`.
18
15
'''
19
16
20
17
from cluster_toolkit import _dcast , _lib
23
20
import scipy .special as spec
24
21
25
22
23
+ __BBPS_params_P_0 = (18.1 , 0.154 , - 0.758 )
24
+ __BBPS_params_x_c = (0.497 , - 0.00865 , 0.731 )
25
+ __BBPS_params_beta = (4.35 , 0.0393 , 0.415 )
26
+
27
+
26
28
def P_BBPS (r , M , z , omega_b , omega_m ,
27
- params_P_0 = ( 18.1 , 0.154 , - 0.758 ) ,
28
- params_x_c = ( 0.497 , - 0.00865 , 0.731 ) ,
29
- params_beta = ( 4.35 , 0.0393 , 0.415 ) ,
29
+ params_P_0 = __BBPS_params_P_0 ,
30
+ params_x_c = __BBPS_params_x_c ,
31
+ params_beta = __BBPS_params_beta ,
30
32
alpha = 1 , gamma = - 0.3 ,
31
33
delta = 200 ):
32
34
'''
@@ -42,11 +44,14 @@ def P_BBPS(r, M, z, omega_b, omega_m,
42
44
omega_m (float): Matter fraction.
43
45
params_P_0 (tuple): 3-tuple of :math:`P_0` mass, redshift dependence \
44
46
parameters A, :math:`\\ alpha_m`, :math:`\\ alpha_z`, \
45
- respectively. See BBPS2 Equation 11.
47
+ respectively. See BBPS2 Equation 11. Default is BBPS2's \
48
+ best-fit.
46
49
params_x_c (tuple): 3-tuple of :math:`x_c` mass, redshift dependence, \
47
- same as `params_P_0`.
50
+ same as `params_P_0`. Default is BBPS2's \
51
+ best-fit.
48
52
params_beta (tuple): 3-tuple of :math:`\\ beta` mass, redshift \
49
- dependence, same as `params_P_0`.
53
+ dependence, same as `params_P_0`. Default is BBPS2's \
54
+ best-fit.
50
55
51
56
Returns:
52
57
float: Pressure at distance `r` from the cluster, in units of \
@@ -83,9 +88,9 @@ def P_BBPS(r, M, z, omega_b, omega_m,
83
88
84
89
85
90
def projected_P_BBPS (r , M , z , omega_b , omega_m ,
86
- params_P = ( 18.1 , 0.154 , - 0.758 ) ,
87
- params_x_c = ( 0.497 , - 0.00865 , 0.731 ) ,
88
- params_beta = ( 4.35 , 0.0393 , 0.415 ) ,
91
+ params_P_0 = __BBPS_params_P_0 ,
92
+ params_x_c = __BBPS_params_x_c ,
93
+ params_beta = __BBPS_params_beta ,
89
94
alpha = 1 , gamma = - 0.3 ,
90
95
delta = 200 ,
91
96
limit = 1000 ,
@@ -101,6 +106,16 @@ def projected_P_BBPS(r, M, z, omega_b, omega_m,
101
106
z (float): Cluster redshift.
102
107
omega_b (float): Baryon fraction.
103
108
omega_m (float): Matter fraction.
109
+ params_P_0 (tuple): 3-tuple of :math:`P_0` mass, redshift dependence \
110
+ parameters A, :math:`\\ alpha_m`, :math:`\\ alpha_z`, \
111
+ respectively. See BBPS2 Equation 11. Default is BBPS2's \
112
+ best-fit.
113
+ params_x_c (tuple): 3-tuple of :math:`x_c` mass, redshift dependence, \
114
+ same as `params_P_0`. Default is BBPS2's \
115
+ best-fit.
116
+ params_beta (tuple): 3-tuple of :math:`\\ beta` mass, redshift \
117
+ dependence, same as `params_P_0`. Default is BBPS2's \
118
+ best-fit.
104
119
105
120
Returns:
106
121
float or array: Integrated line-of-sight pressure at distance `r` from \
@@ -120,7 +135,7 @@ def projected_P_BBPS(r, M, z, omega_b, omega_m,
120
135
P_err_out = np .zeros_like (r , dtype = np .double )
121
136
122
137
# Set parameters
123
- P_0 = _A_BBPS (M , z , * params_P )
138
+ P_0 = _A_BBPS (M , z , * params_P_0 )
124
139
x_c = _A_BBPS (M , z , * params_x_c )
125
140
beta = _A_BBPS (M , z , * params_beta )
126
141
@@ -169,13 +184,13 @@ def R_delta(M, z, omega_m, delta=200):
169
184
{8 \\ pi \\ Delta \\ rho_{crit}}\Big)^{1/3}`
170
185
171
186
Args:
172
- M (float): Halo mass :math:`M_{\\ Delta}`, in units of Msun.
173
- z (float): Redshift to the cluster center.
174
- omega_m (float): The matter fraction :math:`\\ Omega_m`.
175
- delta (float): The halo overdensity :math:`\\ Delta`.
187
+ M (float or array ): Halo mass :math:`M_{\\ Delta}`, in units of Msun.
188
+ z (float or array ): Redshift to the cluster center.
189
+ omega_m (float or array ): The matter fraction :math:`\\ Omega_m`.
190
+ delta (float or array ): The halo overdensity :math:`\\ Delta`.
176
191
177
192
Returns:
178
- float: Radius, in :math:`\\ text{Mpc} h^\\ frac{-2}{3}`.
193
+ float or array : Radius, in :math:`\\ text{Mpc} h^\\ frac{-2}{3}`.
179
194
'''
180
195
volume = M / (delta * _rho_crit (z , omega_m ))
181
196
return (3 * volume / (4 * np .pi ))** (1. / 3 )
@@ -205,15 +220,6 @@ def P_delta(M, z, omega_b, omega_m, delta=200):
205
220
(omega_b / omega_m ) / (2 * R_delta (M , z , omega_m , delta ))
206
221
207
222
208
- def P_simple_BBPS_generalized (x , M , z , P_0 , x_c , beta ,
209
- alpha = 1 , gamma = - 0.3 , delta = 200 ):
210
- '''
211
- The generalized dimensionless BBPS pressure profile. Input x should be
212
- :math:`r / R_{\\ Delta}`.
213
- '''
214
- return P_0 * (x / x_c )** gamma * (1 + (x / x_c )** alpha )** (- beta )
215
-
216
-
217
223
def _A_BBPS (M , z , A_0 , alpha_m , alpha_z ):
218
224
'''
219
225
Mass-Redshift dependency model for the generalized BBPS profile parameters,
@@ -223,20 +229,12 @@ def _A_BBPS(M, z, A_0, alpha_m, alpha_z):
223
229
return A_0 * (M / 10 ** 14 )** alpha_m * (1 + z )** alpha_z
224
230
225
231
226
- def P_simple_BBPS (x , M , z ):
227
- '''
228
- The best-fit pressure profile presented in BBPS2.
229
- '''
230
- params_P = (18.1 , 0.154 , - 0.758 )
231
- params_x_c = (0.497 , - 0.00865 , 0.731 )
232
- params_beta = (4.35 , 0.0393 , 0.415 )
233
- P_0 = _A_BBPS (M , z , * params_P )
234
- x_c = _A_BBPS (M , z , * params_x_c )
235
- beta = _A_BBPS (M , z , * params_beta )
236
- return P_simple_BBPS_generalized (x , M , z , P_0 , x_c , beta )
237
-
238
-
239
232
def projected_y_BBPS (r , M , z , omega_b , omega_m ,
233
+ params_P_0 = __BBPS_params_P_0 ,
234
+ params_x_c = __BBPS_params_x_c ,
235
+ params_beta = __BBPS_params_beta ,
236
+ alpha = 1 , gamma = - 0.3 ,
237
+ delta = 200 ,
240
238
Xh = 0.76 , epsrel = 1e-3 ):
241
239
'''
242
240
Projected Compton-y parameter along the line of sight, at a perpendicular
@@ -263,6 +261,11 @@ def projected_y_BBPS(r, M, z, omega_b, omega_m,
263
261
# equation to do so, see BBPS2 p. 3.
264
262
ch = (2 * Xh + 2 ) / (5 * Xh + 3 )
265
263
return ch * cy * projected_P_BBPS (r , M , z , omega_b , omega_m ,
264
+ params_P_0 = params_P_0 ,
265
+ params_x_c = params_x_c ,
266
+ params_beta = params_beta ,
267
+ alpha = alpha , gamma = gamma ,
268
+ delta = delta ,
266
269
epsrel = epsrel )
267
270
268
271
@@ -306,8 +309,8 @@ def smoothed_xi(theta, M, z, omega_b, omega_m, da,
306
309
# The following functions are for testing only!! #
307
310
##################################################
308
311
309
- def py_projected_P_BBPS (r , M , z , omega_b , omega_m ,
310
- dist = 8 , epsrel = 1e-3 ):
312
+ def _py_projected_P_BBPS (r , M , z , omega_b , omega_m ,
313
+ dist = 8 , epsrel = 1e-3 ):
311
314
'''
312
315
Computes the projected line-of-sight density of a cluster at a radius r
313
316
from the cluster center.
@@ -330,8 +333,8 @@ def py_projected_P_BBPS(r, M, z, omega_b, omega_m,
330
333
epsrel = epsrel )[0 ] / (1 + z )
331
334
332
335
333
- def projected_P_BBPS_real (r , M , z , omega_b , omega_m , chis , zs ,
334
- dist = 8 , epsrel = 1e-3 ):
336
+ def _projected_P_BBPS_real (r , M , z , omega_b , omega_m , chis , zs ,
337
+ dist = 8 , epsrel = 1e-3 ):
335
338
'''
336
339
Computes the projected line-of-sight density of a cluster at a radius r
337
340
from the cluster center.
0 commit comments