Hi guys,<br><br>I want to use the nparticles rather than the particles
callback so that I only plot PARTICLE_TYPE_MUST_REFINE (4). I am trying
(full script at end of email):<br><br>    p.modify["nparticles"](1.0,p_<div id=":1ku" class="ii gt">size=4.0, col='g', ptype='4')<br>
<br>I tried with and without ' around the 4 but both times I get:<br><br>Traceback (most recent call last):<br>  File "Density_movie.py", line 29, in <module><br>    p.modify["nparticles"](1.0,p_size=4.0, col='g', ptype='4')<br>

  File "/scratch/YT-x86_64/lib/python2.5/site-packages/yt-1.6dev-py2.5-linux-x86_64.egg/yt/raven/PlotTypes.py", line 52, in __getitem__<br>    raise KeyError(item)<br>KeyError: 'nparticles'<br><br>Any idea what I am doing wrong?<br>

<br>Many thanks,<br><br>Libby<br><br>Density_movie.py:<br><br>from yt.mods import *<br>import pylab<br>import sys<br>import cmath<br>import matplotlib.ticker<br><br>#<br># Code to make the frames for a movie showing density projection<br>

#<br><br>rho_min = 1.e-22<br>rho_max = 1.e-32<br><br>frame_template = "aaWoC/%s/densityframe_%01i_%04i"<br><br>for n in range(12,200): # make density projection with particles on<br>    #pf = lagos.EnzoStaticOutput("WOCbin/%s/DD%04i/data%04i" % (sys.argv[-1],n, n))<br>

    pf = lagos.EnzoStaticOutput("WOCbin2/%s/DD%04i/data%04i" % (sys.argv[-1],n, n))<br>    #print pf.h.field_list<br>    pc = raven.PlotCollection(pf, center=(0.5,0.5,0.5))<br>    time = pf["InitialTime"]*pf["years"]<br>

    for ax in range(1):<br>        p = pc.add_projection("Density", ax, weight_field="Density")<br>        #pc.set_zlim(rho_min, rho_max)<br>        p.set_cmap('hot')<br>        sp = pf.h.all_data()<br>

        colours = sp["ParticleMassMsun"]<br>        if sp["ParticleMassMsun"].size > 0:<br>            p.modify["nparticles"](1.0,p_size=4.0, col='g', ptype='4')<br>        p.modify["text"]((0.1,0.9),"time = %i years" % (pf["InitialTime"]*pf["years"]), text_args = {'color':'w'})<br>

        #p.set_width(0.1, 'pc')<br>        pc.save(frame_template % (sys.argv[-1],ax,n), override=True)<br><br></div><br clear="all"><br>-- <br>Elizabeth Harper-Clark MA MSci<br>PhD Candidate, Astrophysics, UofT<br>
<br><a href="http://www.astro.utoronto.ca/~h-clark">www.astro.utoronto.ca/~h-clark</a><br><a href="mailto:h-clark@cita.utoronto.ca">h-clark@cita.utoronto.ca</a><br>AIM: edphc1<br>MSN: <a href="mailto:edphc1@hotmail.com">edphc1@hotmail.com</a><br>
Skype: eharperclark<br>Office phone: 416-978-5759<br>