Total_metal_mass = (np.sum(Stellar_met*S['m']) + np.sum(Metallicity*G['m'])) OxyYield = (np.sum(Stellar_oxygen*S['m']) + np.sum(Gas_oxygen*G['m'])) / np.sum(S['m']) EmpiricalYield = Total_metal_mass / np.sum(S['m']) a = G['header'][2] z = 1.0/a - 1.0 redshift = G['header'][3] boxsize = G['header'][9] omega_matter = G['header'][10] omega_L = G['header'][11] h = G['header'][12] redshiftstring = "{0:.3f}".format(redshift) Hubble = hubble_param(a, omega_matter, h) PhysTemp, PhysRho = SF.convertTemp(G['u'], G['ne'], G['rho'], h) halostats = SF.find_halo_now(halo_to_do, a, therod=use_fixed_halos) print 'halo stats', halostats haloN = halostats[1] #read halo catalog, assign halo properties Rvir = halostats[11] Vsig = halostats[10] haloX = halostats[2] haloY = halostats[3] haloZ = halostats[4] haloVX =halostats[5] haloVY = halostats[6] haloVZ = halostats[7]
boxsize = header[9] if wanted == 'rhoTwind': cutz = (np.absolute(partZ)>zdown) & (np.absolute(partZ)<zup) #kpc cutxy = partX*partX+partY*partY<withinr*withinr if cosmo==1: cutv = partXV*partX+partYV*partY\ +partZV*partZ>vcut*np.sqrt(partX*partX+partY*partY+partZ*partZ) #outflowing gas else: cutv = partZV*partZ/np.absolute(partZ)>vcut #outflowing gas cut = cutz*cutxy*cutv Tb = Tb[cut] rho = rho[cut] Neb = Neb[cut] Gmass = Gmass[cut] TrueTemp, converted_rho = SF.convertTemp(Tb, Neb, rho) if wanted == 'rhoT': if needcontour==1: totalname = 'CRplot/rhoT/rhoT_'+runtodo+'_sn'+str(startno)+'_'+str(Nsnap)+'_contour.pdf' else: totalname = 'CRplot/rhoT/rhoT_'+runtodo+'_sn'+str(startno)+'_'+str(Nsnap)+'.pdf' elif wanted == 'rhoTwind': if needcontour==1: totalname = 'CRplot/rhoTwind/rhoTwind_'+runtodo+'_sn'+str(startno)+'_'+str(Nsnap)+'_contour.pdf' else: totalname = 'CRplot/rhoTwind/rhoTwind_'+runtodo+'_sn'+str(startno)+'_'+str(Nsnap)+'.pdf' y = np.log10(TrueTemp) x = np.log10(converted_rho) gridxx = np.linspace(extent[0],extent[1],nobin) gridyy = np.linspace(extent[2],extent[3],nobin) #gridxx = np.linspace(np.amin(x),np.amax(x),nobin)