@@ -228,8 +228,7 @@ def Pth_Battaglia2012(radius_mpc, M200_SM, redshift_z, load_vars_dict = None,
228
228
return _Pth_Battaglia2012 (P0 , radius_mpc , R200_Mpc , alpha , beta , gamma , xc )
229
229
230
230
231
- def Pe_to_y (profile , radii_mpc , M200_SM , redshift_z , load_vars_dict , alpha = 1.0 , gamma = - 0.3 , R200_Mpc = None ,
232
- Rmaxy = None ):
231
+ def Pe_to_y (profile , radii_mpc , M200_SM , redshift_z , load_vars_dict , alpha = 1.0 , gamma = - 0.3 , R200_Mpc = None ):
233
232
'''
234
233
Converts from an electron pressure profile to a compton-y profile,
235
234
integrates over line of sight from -1 to 1 Mpc relative to center.
@@ -264,28 +263,12 @@ def Pe_to_y(profile, radii_mpc, M200_SM, redshift_z, load_vars_dict, alpha = 1.0
264
263
if R200_Mpc is None :
265
264
R200_Mpc = get_r200_angsize_and_c200 (M200_SM , redshift_z , load_vars_dict )[1 ]
266
265
radii_mpc = (radii_mpc * u .Mpc ).value
267
- if Rmaxy is None :
268
- rmax = radii_mpc .max ()
269
- elif '200' in Rmaxy :
270
- rmax = R200_Mpc
271
- else :
272
- print ('please specify a valid `Rmaxy`' )
273
- return None
274
266
if profile != "Battaglia2012" :
275
267
print ("only implementing `Battaglia2012` for profile" )
276
268
profile = Pth_Battaglia2012
277
269
pressure_integ = np .empty_like (radii_mpc )
278
270
P200_kevcm3 = P200_Battaglia2012 (M200_SM , redshift_z , load_vars_dict , R200_Mpc = R200_Mpc ).value
279
271
280
- # integral = np.trapz(np.array([profile(np.sqrt(np.linspace(0, np.sqrt(radii_mpc.max()**2. - rv**2.)+1.,
281
- # 1000)**2 +
282
- # rv**2), M200_SM, redshift_z, load_vars_dict = None, alpha = alpha,
283
- # gamma = gamma, R200_Mpc = r200) for rv in radii_mpc]), np.array([np.linspace(0,
284
- # np.sqrt(radii_mpc.max(
285
- # )**2. - rv**2.)+1., 1000) for rv in radii_mpc]))
286
- # y_pro = integral * P200_kevcm3 * keVcm3_to_Jm3 * Thomson_scale * \
287
- # thermal_to_electron_pressure * 2*Mpc_to_m
288
- # return y_pro
289
272
for i , radius in enumerate (radii_mpc ):
290
273
# Multiply profile by P200 specifically for Battaglia 2012 profile,
291
274
# since it returns Pth/P200 instead of Pth
@@ -303,7 +286,7 @@ def Pe_to_y(profile, radii_mpc, M200_SM, redshift_z, load_vars_dict, alpha = 1.0
303
286
304
287
305
288
def _make_y_submap (profile , M200_SM , redshift_z , load_vars_dict , image_size_pixels , pixel_size_arcmin , alpha = 1.0 ,
306
- gamma = - 0.3 , R200_Mpc = None , Rmaxy = None ):
289
+ gamma = - 0.3 , R200_Mpc = None ):
307
290
'''
308
291
Converts from an electron pressure profile to a compton-y profile,
309
292
integrates over line of sight from -1 to 1 Mpc relative to center.
@@ -324,6 +307,10 @@ def _make_y_submap(profile, M200_SM, redshift_z, load_vars_dict, image_size_pixe
324
307
size of final submap in number of pixels
325
308
pixel_size_arcmin: float
326
309
size of each pixel in arcmin
310
+ alpha: float
311
+ variable fixed by Battaglia et al 2012 to 1.0
312
+ gamma: float
313
+ variable fixed by Battaglia et al 2012 to -0.3
327
314
R200_Mpc: None or float
328
315
if None, will calculate the radius that corresponds to the mass M200, the redshift redshift_z,
329
316
and the cosmology contained in load_vars_dict
@@ -341,8 +328,7 @@ def _make_y_submap(profile, M200_SM, redshift_z, load_vars_dict, image_size_pixe
341
328
mindist = utils .arcmin_to_Mpc (pixel_size_arcmin * 0.1 , redshift_z , load_vars_dict ['cosmo' ])
342
329
R = np .maximum (mindist , np .sqrt (X [:, None ]** 2 + X [None , :]** 2 ).flatten ())
343
330
344
- cy = Pe_to_y (profile , R , M200_SM , redshift_z , load_vars_dict , alpha = alpha , gamma = gamma , R200_Mpc = R200_Mpc ,
345
- Rmaxy = Rmaxy ) #
331
+ cy = Pe_to_y (profile , R , M200_SM , redshift_z , load_vars_dict , alpha = alpha , gamma = gamma , R200_Mpc = R200_Mpc ) #
346
332
# evaluate compton-y for each
347
333
# neccesary radius
348
334
@@ -366,7 +352,7 @@ def _make_y_submap(profile, M200_SM, redshift_z, load_vars_dict, image_size_pixe
366
352
367
353
def generate_y_submap (M200_SM , redshift_z , profile = "Battaglia2012" ,
368
354
image_size_pixels = None , pixel_size_arcmin = None , load_vars_dict = None , alpha = 1.0 , gamma = - 0.3 ,
369
- R200_Mpc = None , Rmaxy = None ):
355
+ R200_Mpc = None ):
370
356
'''
371
357
Converts from an electron pressure profile to a compton-y profile,
372
358
integrates over line of sight from -1 to 1 Mpc relative to center.
@@ -387,6 +373,10 @@ def generate_y_submap(M200_SM, redshift_z, profile = "Battaglia2012",
387
373
load_vars_dict: dict
388
374
result of running the load_vars() function, which includes a dictionary of cosmological and experimental
389
375
parameters
376
+ alpha: float
377
+ variable fixed by Battaglia et al 2012 to 1.0
378
+ gamma: float
379
+ variable fixed by Battaglia et al 2012 to -0.3
390
380
R200_Mpc: None or float
391
381
if None, will calculate the radius that corresponds to the mass M200, the redshift redshift_z,
392
382
and the cosmology contained in load_vars_dict
@@ -406,7 +396,7 @@ def generate_y_submap(M200_SM, redshift_z, profile = "Battaglia2012",
406
396
407
397
y_map = _make_y_submap (profile , M200_SM , redshift_z , load_vars_dict ,
408
398
image_size_pixels , pixel_size_arcmin ,
409
- alpha = alpha , gamma = gamma , R200_Mpc = R200_Mpc , Rmaxy = Rmaxy )
399
+ alpha = alpha , gamma = gamma , R200_Mpc = R200_Mpc )
410
400
411
401
return y_map
412
402
@@ -421,6 +411,9 @@ def get_r200_angsize_and_c200(M200_SM, redshift_z, load_vars_dict, angsize_densi
421
411
load_vars_dict: dict
422
412
must contain 'cosmo' (a FlatLambaCDM instance describing the background cosmology),
423
413
'sigma8' (float, around 0.8), and 'ns' (float, around 0.96)
414
+ angsize_density: None or str
415
+ density measure at which to calculate the angular size, if desired. If `None`, will not
416
+ calculate an angular size. Otherwise, use a valid choice as specified in `colossus.halo.mass_adv`
424
417
425
418
Returns:
426
419
-------
0 commit comments