Skip to content

Commit

Permalink
added tSZ signal function to make_sz_cluster.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Elaine Ran committed Jul 26, 2023
1 parent 2663e4b commit 0bde20e
Show file tree
Hide file tree
Showing 15 changed files with 1,087 additions and 757,684 deletions.
Binary file added Data/.z(0.0~1.5)num_105441.csv.icloud
Binary file not shown.
105,442 changes: 0 additions & 105,442 deletions Data/z(0.0~1.5)num_105441.csv

This file was deleted.

2,000 changes: 1,000 additions & 1,000 deletions flatmassdist.csv

Large diffs are not rendered by default.

35 changes: 20 additions & 15 deletions make_sz_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,6 @@ def make_proj_image_new(radius, profile,range=18,pixel_scale=0.5,extrapolate=Fal

return image, x, y, r


def tSZ_signal(z, Map):
"""
https://kbarbary-astropy.readthedocs.io/en/latest/_modules/astropy/cosmology/funcs.html#kpc_proper_per_arcmin
"""

rin, rout = calc_radius(z)

disk_mean = Map[r < rin].mean()
ring_mean = Map[(r >= rin) & (r < rout)].mean()
tSZ = disk_mean - ring_mean

return tSZ, rin


def battaglia_profile(r, Mvir, z, cosmo): #THIS IS OLD; WILL LIKELY DELETE SOON
'''
Using Battaglia et al (2012). Eq. 10.
Expand Down Expand Up @@ -282,6 +267,26 @@ def battaglia_profile(r, Mvir, z, cosmo): #THIS IS OLD; WILL LIKELY DELETE SOON

return p_e, M200, R200, c200

def tSZ_signal(self, Map, radmax, fmax=np.sqrt(2)):
"""
Parameters:
Map
radmax: the radius of the inner radius
Returns: The average value within an annulus of inner radius R, outer radius sqrt(2)*R, and the tSZ signal
"""

center = np.array(Map.shape) / 2
x, y = np.indices(Map.shape)
r = np.sqrt((x - center[0])**2 + (y - center[1])**2)

radius_out=radmax * fmax #define outer radius
disk_mean = Map[r < radmax].mean() #average in inner radius
ring_mean = Map[(r >= radmax) & (r < radius_out)].mean() #average in outer radius
tSZ = disk_mean - ring_mean

return disk_mean, ring_mean, tSZ

def m200_to_r200(self,cosmo,sigma8,ns,M200,z):

params = {'flat': True, 'H0': cosmo.H0.value, 'Om0': cosmo.Om0, 'Ob0': cosmo.Ob0, 'sigma8':sigma8, 'ns': ns}
Expand Down
Binary file added notebooks/.ACTDR5_F1.ipynb.icloud
Binary file not shown.
Binary file added notebooks/.ACTDR5_F1_2.ipynb.icloud
Binary file not shown.
Binary file added notebooks/.angular diameter distance.ipynb.icloud
Binary file not shown.
Binary file added notebooks/.angular diameter distance2.ipynb.icloud
Binary file not shown.
Binary file added notebooks/.generator_F2.ipynb.icloud
Binary file not shown.
121,141 changes: 0 additions & 121,141 deletions notebooks/ACTDR5_F1.ipynb

This file was deleted.

121,245 changes: 0 additions & 121,245 deletions notebooks/ACTDR5_F1_2.ipynb

This file was deleted.

104,022 changes: 0 additions & 104,022 deletions notebooks/angular diameter distance.ipynb

This file was deleted.

103,977 changes: 0 additions & 103,977 deletions notebooks/angular diameter distance2.ipynb

This file was deleted.

Loading

0 comments on commit 0bde20e

Please sign in to comment.