[yt-users] Total Active Particles?

David Collins dcollins4096 at gmail.com
Fri May 13 14:03:45 PDT 2016


Cool.  I may try my hand at such an object.

The problem with doing something like ad['CenOstriker','creation_time'] is
that if there are no particles it raises an error, so for smooth flying I'd
need to put it in a try/except, but that's not a huge deal.


Thanks!
d.

On Fri, May 13, 2016 at 4:42 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> 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
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>


-- 
-- Sent from a computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160513/f0ed7889/attachment.html>


More information about the yt-users mailing list