[yt-dev] Issue #718: Convenience method to get the number of particles in a simulation (yt_analysis/yt)

Nathan Goldbaum issues-reply at bitbucket.org
Wed Nov 6 17:20:11 PST 2013


New issue 718: Convenience method to get the number of particles in a simulation
https://bitbucket.org/yt_analysis/yt/issue/718/convenience-method-to-get-the-number-of

Nathan Goldbaum:

It should be possible to do something like:

```
#!python

pf = load(...)
nparticles = pf.h.number_of_particles
```

Right now (as far as I can tell with enzo data) one needs to iterate over all the grids, accumulating particle counts along the way.  This data has to be known once the hierarchy is parsed so I think it should be straightforward to add this.

What do you think @MatthewTurk?







More information about the yt-dev mailing list