Code to plot IMFs at each time step and a graph of the evolution of the particles with time
from yt.mods import * import pylab import sys i_mass = na.zeros((5001,56), dtype='float64') for i in range(56): # make matricies of index and mass by time and particle number pf = EnzoStaticOutput("%s/data%04i" % (sys.argv[-1], i)) sp = pf.h.sphere([0.5,0.5,0.5], 1.0) if sp["ParticleMassMsun"].size == 0: continue for k in range(sp["particle mass"].size): j = sp["particle_index"][k] -1 i_mass[j,i]=sp["ParticleMassMsun"][k] pylab.hist(sp["ParticleMassMsun"]) pylab.savefig("IMF_%04i.png" % i) pylab.clf() pylab.plot( i_mass.transpose() ) pylab.axis([38, 55, 0, 3]) pylab.legend() pylab.savefig("Particle_evolution.png") pylab.clf()
