q_parametre_hydro.py 3.55 KB
 NUNEZ Arturo committed Jul 20, 2018 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ``````import numpy as np import sys from py_unsio import * import os import wkbl import wkbl.astro.nbody_essentials as nbe import cfalcon CF =cfalcon.CFalcon() import warnings warnings.filterwarnings('ignore') path = sys.argv[1] simname = sys.argv[2] """ myhalo = wkbl.Galaxy_Hound(path,"halo,gas,stars") print "centering recursively on Zoom Region COM" ok,rho,_= CF.getDensity(np.array(myhalo.st.pos3d.reshape(len(myhalo.st.pos3d)*3),dtype=np.float32), myhalo.st.mass) centro_rho = myhalo.st.pos3d[np.where(rho == rho.max())][0] print "density",centro_rho myhalo.center_shift(centro_rho) myhalo.r_virial(600,n=2) """ myhalo= wkbl.Galaxy_Hound(path) print "loaded" zoomreg = np.where(myhalo.dm.mass==myhalo.dm.mass.min()) centro = nbe.real_center(myhalo.dm.pos3d[zoomreg],myhalo.dm.mass[zoomreg]) print centro myhalo.center_shift(centro) myhalo.r_virial(600,n=2) myhalo.r200 myhalo.redefine(25) print "recentering" centro = nbe.real_center(myhalo.dm.pos3d[myhalo.dm.r<50],myhalo.dm.mass[myhalo.dm.r<50]) print centro myhalo.center_shift(centro) myhalo.r_virial(600,n=2) myGkm = 6.673e-11*(1e-3**3)*myhalo.p.msuntokg#km^ 3 Msun^-1 s^-2 #""" print "r200 = {0}".format(myhalo.r200) print "M_dm_200 = {0:.5e}".format(np.sum(myhalo.dm.mass[myhalo.dm.r