<div dir="ltr">This uses the ActiveParticleCosmology dataset from <a href="http://yt-project.org/data">yt-project.org/data</a>:<div><br></div><div><div>    import yt</div><div>    ds = yt.load('ActiveParticleCosmology/DD0046/DD0046')</div><div>    ad = ds.all_data()</div><div>    print(ad['CenOstriker', 'creation_time'].shape)</div></div><div><br></div><div>Which prints out (899755,), so there are 899755 active particles in this simulation.</div><div><br></div><div>There isn't a convenience function to get the number of each particle type in the simulation. Adding such a convenience function (or populating some Dataset attribute with this information when we load the data so we don't need to make another I/O pass over the dataset) would be a great addition to yt. There's even a very long-standing issue opened by me about this...</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/issues/718">https://bitbucket.org/yt_analysis/yt/issues/718</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 3:32 PM, David Collins <span dir="ltr"><<a href="mailto:dcollins4096@gmail.com" target="_blank">dcollins4096@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, Everybody!<div><br></div><div>Is there a field or function that totals the number of active particles?  I see that I can get it from the grid, but I don't see anything for the whole ds.</div><div><br></div><div>Thanks,</div><div>d.<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div><div dir="ltr">-- Sent from a computer.<br></div></div>
</font></span></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>