-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchange_mass.py
executable file
·58 lines (49 loc) · 2.14 KB
/
change_mass.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
###Calculates theoretical expecations for splashback radii of the clusters
from colossus.cosmology import cosmology
from colossus.halo import concentration
from colossus.halo.mass_defs import changeMassDefinition
import colossus.halo.splashback as sb
h = 0.7 #Hubble parameter
cosmology.setCosmology('bolshoi')
def calc_stat(mass, redshift, mass_definition = "200m"):
if mass_definition == "200m":
M200m = mass
c200m = concentration.concentration(M200m, mass_definition, redshift)
M500c, R500c, c500c = changeMassDefinition(M200m, c200m, redshift,'200m', '500c', profile = 'nfw')
elif mass_definition == "500c":
M500c = mass
c500c = concentration.concentration(M500c, '500c', redshift)
M200m, R200m, c200m = changeMassDefinition(M500c, c500c, redshift,'500c', '200m')
Rsp = sb.splashbackRadius(redshift, '200m', M = M200m)[0]*(1 + redshift)
return M200m, M500c, R200m, Rsp
if __name__=="__main__":
#RedMaPPer
mass = 1.8e14
redshift = 0.24
M200m, M500c, R200m = calc_stat(mass, redshift, mass_defintion)
print("RedMaPPer:")
print("######################################")
print("R200m is: %E kpc/h" % R200m)
print("M500c is %E Msol/h and M200m is %E Msol/h" % (M500c, M200m))
print("The splashback radius is: %f kpc/h" % Rsp)
print("######################################")
#SZ
mass = 4.3e14*h
redshift = 0.177
M200m, M500c, R200m = calc_stat(mass, redshift, mass_defintion)
print("SZ:")
print("######################################")
print("R200m is: %E kpc/h" % R200m)
print("M500c is %E Msol/h and M200m is %E Msol/h" % (M500c, M200m))
print("The splashback radius is: %f kpc/h" % Rsp)
print("######################################")
#XR
mass = 2.3e14*h
redshift = 0.186
M200m, M500c, R200m = calc_stat(mass, redshift, mass_defintion)
print("XR:")
print("######################################")
print("R200m is: %E kpc/h" % R200m)
print("M500c is %E Msol/h and M200m is %E Msol/h" % (M500c, M200m))
print("The splashback radius is: %f kpc/h" % Rsp)
print("######################################")