[yt-svn] commit/yt: MatthewTurk: Adding particle union note.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jul 29 20:40:59 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/5c66a578b247/
Changeset:   5c66a578b247
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-07-30 05:11:52
Summary:     Adding particle union note.
Affected #:  1 file

diff -r cf0ab6db87aec986ff11bd5968c0e9203d90a5cf -r 5c66a578b2470c405cd465bc1ca05bc400d696c9 doc/source/analyzing/filtering.rst
--- a/doc/source/analyzing/filtering.rst
+++ b/doc/source/analyzing/filtering.rst
@@ -139,6 +139,32 @@
 
 .. notebook:: particle_filter.ipynb
 
+.. _particle-unions:
+
+Particle Unions
+---------------
+
+Multiple types of particles can be combined into a single, conceptual type.  As
+an example, the NMSU-ART code has multiple "species" of dark matter, which we
+union into a single ``darkmatter`` field.  The ``all`` particle type is a
+special case of this.
+
+To create a particle union, you need to import the ``ParticleUnion`` class from
+``yt.data_objects.particle_unions``, which you then create and pass into
+``add_particle_union`` on a dataset object.
+
+Here is an example, where we union the ``halo`` and ``disk`` particle types
+into a single type, ``star``.  yt will then determine which fields are
+accessible to this new particle type and it will add them.
+
+.. code-block:: python
+
+   from yt.data_objects.particle_unions import \
+       ParticleUnion
+
+   u = ParticleUnion("star", ["halo", "disk"])
+   ds.add_particle_union(u)
+
 .. _filtering-by-location:
 
 Filtering Fields by Spatial Location: Geometric Objects

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list