Exemplo n.º 1
0
Mstar = halostats[13]
Mgas = halostats[12]
Vmax = halostats[9]

print Rvir, Vsig, M, 'before'
Rvir, Vsig, M = SF.check_Rvir_growth(halo_to_do, a, Rvir, Vsig, M, therod=use_fixed_halos)
print Rvir, Vsig, M, 'after'

if (use_OuterBoundary):
	Rvir = OuterBoundary_physical * h / a

#setting the locations of each spherical shell, as a fraction of Rvir
R_bin_array_min = np.array([0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
R_bin_array_max = R_bin_array_min+0.1

Gclose = OR.prepare_X_close(G, Rvir, haloX, haloY, haloZ)	
Gdists = SF.calcdist2(haloX, haloY, haloZ, G['p'][:,0][Gclose], G['p'][:,1][Gclose], G['p'][:,2][Gclose], boxsize)
Ghalo = Gdists < Rvir



#Hubble = hubble_param(a, omega_matter, h)

GprelX = G['p'][:,0][Gclose][Ghalo] - haloX
GprelY = G['p'][:,1][Gclose][Ghalo] - haloY
GprelZ = G['p'][:,2][Gclose][Ghalo] - haloZ	
GvrelX = G['v'][:,0][Gclose][Ghalo] * np.sqrt(a) - haloVX + GprelX*a*Hubble/(h*1000)
GvrelY = G['v'][:,1][Gclose][Ghalo] * np.sqrt(a) - haloVY + GprelY*a*Hubble/(h*1000)
GvrelZ = G['v'][:,2][Gclose][Ghalo] * np.sqrt(a) - haloVZ +  GprelZ*a*Hubble/(h*1000)
#rescale positions so that magnitude = 1 (unit vectors)
GprelX_RS = GprelX / Gdists[Ghalo]
Exemplo n.º 2
0
haloVZ = halostats[7]
M = halostats[8]
Mstar = halostats[13]
Mgas = halostats[12]
Vmax = halostats[9]

print Rvir, Vsig, M, 'before'
Rvir, Vsig, M = SF.check_Rvir_growth(halo_to_do,
                                     a,
                                     Rvir,
                                     Vsig,
                                     M,
                                     therod=use_fixed_halos)
print Rvir, Vsig, M, 'after'

Gclose = OR.prepare_X_close(G, Rvir, haloX, haloY, haloZ)
Gdists = SF.calcdist2(haloX, haloY, haloZ, G['p'][:, 0][Gclose],
                      G['p'][:, 1][Gclose], G['p'][:, 2][Gclose], boxsize)
Ghalo = Gdists < Rvir

TempCutISM = PhysTemp[Gclose][Ghalo] < TempBound1
TempCutCGMCool = PhysTemp[Gclose][Ghalo] < TempBound2
TempCutCGMWarm = (PhysTemp[Gclose][Ghalo] >=
                  TempBound2) * (PhysTemp[Gclose][Ghalo] < TempBound3)
TempCutCGMHot = PhysTemp[Gclose][Ghalo] >= TempBound3

ISMDensCut = PhysRho[Gclose][Ghalo] > 0.1

MISM1 = np.sum(G['m'][Gclose][Ghalo][ISMDensCut]) * 1e10 / h
MISM2 = np.sum(G['m'][Gclose][Ghalo][ISMDensCut * TempCutISM]) * 1e10 / h