diff --git a/python_sample/build_dipole_ksz_from_galaxies.py b/python_sample/build_dipole_ksz_from_galaxies.py index 77db90d..8cc1932 100644 --- a/python_sample/build_dipole_ksz_from_galaxies.py +++ b/python_sample/build_dipole_ksz_from_galaxies.py @@ -38,7 +38,7 @@ def build_unit_vectors(N): return ux,uy,uz -def generate_from_catalog(dmin,dmax,Nside,do_random=False): +def generate_from_catalog(dmin,dmax,Nside,y=0.0,do_random=False): import progressbar as pbar cat = np.load("2m++.npy") @@ -71,7 +71,7 @@ def generate_from_catalog(dmin,dmax,Nside,do_random=False): DA =i['distance']/100 Lgal = DA**2*10**(0.4*(tmpp_cat['Msun']-i['K2MRS']+25)) - profiler = ksz.KSZ_Isothermal(Lgal, 2.37) + profiler = ksz.KSZ_Isothermal(Lgal, 2.37, y=y) idx0 = hp.query_disc(Nside, (x0,y0,z0), 3*profiler.rGalaxy/DA) @@ -103,6 +103,7 @@ def get_args(): parser.add_argument('--base_fig', type=str, default="kszfig.png") parser.add_argument('--build_dipole', type=bool, default=False) parser.add_argument('--degrade', type=int, default=-1) + parser.add_argument('--y',type=float,default=0.0) parser.add_argument('--random', type=bool, default=False) return parser.parse_args() @@ -116,7 +117,7 @@ def main(): print("Generating map...") - proj,mask = generate_from_catalog(args.depth_min,args.depth_max,args.Nside,do_random=args.random) + proj,mask = generate_from_catalog(args.depth_min,args.depth_max,args.Nside,args.y,do_random=args.random) if args.degrade > 0: proj *= mask diff --git a/python_sample/ksz/gal_prof.py b/python_sample/ksz/gal_prof.py index eb44610..92d9622 100644 --- a/python_sample/ksz/gal_prof.py +++ b/python_sample/ksz/gal_prof.py @@ -46,7 +46,7 @@ class KSZ_Profile(object): class KSZ_Isothermal(KSZ_Profile): sigma_FP=160e3 #m/s - R_innergal = 0.226 + R_innergal = 0.030 def __init__(self, Lgal, x, y=0.0): "Support for Isothermal profile" @@ -71,15 +71,15 @@ class KSZ_Isothermal(KSZ_Profile): Q = np.zeros(r.size) - cond = r <= rInner + cond = (r>=0)*(r <= rInner) D['r'] = r[cond] - ne.evaluate('rho0*2/(Mpc*r) * arctan(sqrt( (rGalaxy/r)**2 -1 ) - arctan(sqrt( (rInner/r)**2 - 1 ))', - local_dict=D, out=Q[cond]) + Q[cond] = ne.evaluate('rho0*2/(Mpc*r) * (arctan(sqrt( (rGalaxy/r)**2 -1 )) - arctan(sqrt( (rInner/r)**2 - 1 )))', + local_dict=D) cond = (r > rInner)*(r <= rGalaxy) D['r'] = r[cond] - ne.evaluate('rho0*2/(Mpc*r) * arctan(sqrt( (rGalaxy/r)**2 -1 ))', - local_dict=D, out=Q[cond]) + Q[cond] = ne.evaluate('rho0*2/(Mpc*r) * arctan(sqrt( (rGalaxy/r)**2 -1 ))', + local_dict=D) return Q,np.where(r