#dec = h[i].star['decomp'] sfh,sfhtimes = find_sfh(h[i],bins=100) hrsfh,hrsfhtimes = find_sfh(h[i],bins=600) sfr = np.sum(h[i].star[fifmyrf]['mass'].in_units('Msol')) / 1.5e7 # where did halo come from? SN or virial shocks # look at all particles inside 2.5 r_vir twopfivef = pynbody.filt.Sphere(2.5*rvir) stfrvir = s[twopfivef] halogas = stfrvir[notdiskf].g[notcooldenf] mtfhalogas = np.sum(halogas['mass'].in_units('Msol')) #iposcoolontime = halogas['coolontime'].in_units('yr')>0 igasords = np.in1d(halogas['iord'],stfrvir.s['igasorder']) halooxhist, halooxbins = mdf(halogas,totmass=mtfhalogas) #cohalooxhist, cohalooxbins = mdf(halogas[iposcoolontime],totmass=mtfhalogas) alpha=pp.density_profile(h[i].dark,filename=simname+'.dmprof.png',center=False, fit=True) ### Save important numbers using pickle. Currently not working for SimArrays pickle.dump({'z':s.properties['z'], 'time':s.properties['time'].in_units('Gyr'), 'rvir':rvir, 'mvir':mvir, 'mgas': np.sum(h[i].gas['mass'].in_units('Msol')), 'mhi':mhi, 'mstar': np.sum(h[i].star['mass'].in_units('Msol')), 'sfr': sfr, # 'mdisk': np.sum(h[i].star[np.where(dec == 1)]['mass'].in_units('Msol')), # 'msphere': np.sum(h[i].star[np.where(dec == 2)]['mass'].in_units('Msol')), # 'mbulge': np.sum(h[i].star[np.where(dec == 3)]['mass'].in_units('Msol')), # 'mthick': np.sum(h[i].star[np.where(dec == 4)]['mass'].in_units('Msol')), # 'mpseudob': np.sum(h[i].star[np.where(dec == 5)]['mass'].in_units('Msol')),
pass try: pp.sbprofile(h[i],filename=simname+'.sbprof.png',center=False) pp.sfh(h[i],filename=simname+'.sfh.png',nbins=500,clear=True) pp.rotation_curve(h[i],filename=simname+'.rc.png',quick=True, max='40 kpc',center=False) pp.rotation_curve(h[i],filename=simname+'.rcparts.png',quick=True, parts=True, legend=True, max='40 kpc',center=False) pp.rho_T(h[i].gas,filename=simname+'.phase.png',rho_units='m_p cm^-3', x_range=[-5,2], y_range=[3,8]) pp.ofefeh(h[i].stars, filename=simname+'.ofefeh.png', weights=h[i].stars['mass'].in_units('Msol'), scalemin=1e3, scalemax=1e9, x_range=[-3,0.3],y_range=[-0.5,1.0]) pp.mdf(h[i].stars,filename=simname+'.mdf.png', range=[-4,0.5]) pp.density_profile(h[i].dark,filename=simname+'.dmprof.png',center=False) plt.clf() plt.loglog(gashaloprof['rbins'].in_units('kpc'), gashaloprof['density'].in_units('m_p cm^-3')) plt.xlabel('r [kpc]') plt.ylabel(r'$\rho$ [m$_p$ cm$^{-3}$]') plt.ylim(1e-4,1e3) plt.xlim(0.5,500) plt.savefig(simname+'.gasdenprof.png') plt.clf() plt.loglog(gashaloprof['rbins'].in_units('kpc'), gashaloprof['temp']) plt.ylim(1e5,1e8) plt.xlim(0.5,500) plt.xlabel('r [kpc]') plt.ylabel('T [K]')
center=False) pp.rho_T(h[i].gas, filename=simname + '.phase.png', rho_units='m_p cm^-3', x_range=[-5, 2], y_range=[3, 8]) pp.ofefeh(h[i].stars, filename=simname + '.ofefeh.png', weights=h[i].stars['mass'].in_units('Msol'), scalemin=1e3, scalemax=1e9, x_range=[-3, 0.3], y_range=[-0.5, 1.0]) pp.mdf(h[i].stars, filename=simname + '.mdf.png', range=[-4, 0.5]) pp.density_profile(h[i].dark, filename=simname + '.dmprof.png', center=False) plt.clf() plt.loglog(gashaloprof['rbins'].in_units('kpc'), gashaloprof['density'].in_units('m_p cm^-3')) plt.xlabel('r [kpc]') plt.ylabel(r'$\rho$ [m$_p$ cm$^{-3}$]') plt.ylim(1e-4, 1e3) plt.xlim(0.5, 500) plt.savefig(simname + '.gasdenprof.png') plt.clf() plt.loglog(gashaloprof['rbins'].in_units('kpc'), gashaloprof['temp']) plt.ylim(1e5, 1e8) plt.xlim(0.5, 500) plt.xlabel('r [kpc]') plt.ylabel('T [K]')