[yt-users] Total Active Particles?

Nathan Goldbaum nathan12343 at gmail.com
Fri May 13 13:42:23 PDT 2016


This uses the ActiveParticleCosmology dataset from yt-project.org/data:

    import yt
    ds = yt.load('ActiveParticleCosmology/DD0046/DD0046')
    ad = ds.all_data()
    print(ad['CenOstriker', 'creation_time'].shape)

Which prints out (899755,), so there are 899755 active particles in this
simulation.

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...

https://bitbucket.org/yt_analysis/yt/issues/718

On Fri, May 13, 2016 at 3:32 PM, David Collins <dcollins4096 at gmail.com>
wrote:

> Hi, Everybody!
>
> 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.
>
> Thanks,
> d.
>
> --
> -- Sent from a computer.
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160513/8648c743/attachment.html>


More information about the yt-users mailing list