pro read_halo filename = "vhalos_036_1e12.dat" nhalos = 0l ; number of halos in the file halo_str = {pos:fltarr(3),$ ; position of the halo in units of Mpc/h mvir:0.0, $ ; mass of the halo in units of Msun/h, defined as the mass ; within a sphere of average density equal to 200 times the ; critical density of the universe vmax:0.0} ; maximum circular velocity, in units of kms/sec openr,1,filename readu,1,nhalos group = replicate({pos:fltarr(3), mvir:0., vmax:0.},nhalos) readu,1, group close,1 z = 0. ; change according to the target snapshot number Hubble = 100. Omega0 = 0.25 G = 43.0071 omegaz = Omega0 * (1+z)^3/ (Omega0*(1+z)^3 + 1-Omega0 ) rho_back = 3 * Omega0 * Hubble^2 / (8 * !PI * G) rho_crit = rho_back/omegaz DeltaCrit200 = 200.0 / omegaz R200 = ( group.mvir / DeltaCrit200/ rho_back / (4.*!Pi/3) )^(1./3) V200 = sqrt(G * group.mvir / R200) stop end