1. The yt Project
  2. yt papers
  3. blog


John ZuHone  committed 0330e89

Changed date; also changed numbers in prompts

  • Participants
  • Parent commits 7e2a0bc
  • Branches default

Comments (0)

Files changed (1)

File content/post/ParticleGenerator.rst

View file
  • Ignore whitespace
 Particle Generators
+.. date: 1357283100
 `Notebook Download <https://hub.yt-project.org/go/mf0ba2>`_
 want to add particles to an already existing set but make sure they have
 uniqune indices.
 .. sourcecode:: python
 Next, we'll set up a uniform grid with some random density data:
 .. sourcecode:: python
 assign\_indices assigns the indices (using numpy.arange by default).
 apply\_to\_stream applies the particle fields to the grid.
 .. sourcecode:: python
 Now that the particles are part of the parameter file, they may be
 manipulated and plotted:
 .. sourcecode:: python
 add\_indices function we defined earlier to assign indices that are all
 different from the ones the already existing particles have.
 .. sourcecode:: python
 We now have both sets of particles:
 .. sourcecode:: python
 And by sorting all of the indices we can check that all of them are
 unique, as advertised:
 .. sourcecode:: python
 distribution and refine the grid based on the overdensity over some
 .. sourcecode:: python
 these particles, we will set the optional argument clobber=True, which
 will remove the particles we already created.
 .. sourcecode:: python
 due to the fact that they are taken from a thick slab and only a slice
 of the grid-based field is shown.
 .. sourcecode:: python