[yt-svn] commit/yt: MatthewTurk: Merged in ngoldbaum/yt (pull request #1408)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jan 16 10:25:00 PST 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/2c440152643c/
Changeset:   2c440152643c
Branch:      yt
User:        MatthewTurk
Date:        2015-01-16 18:24:50+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1408)

Adding a number density field for Enzo MultiSpecies=0 datasets.
Affected #:  1 file

diff -r d8069e2f9549757aacb8cedeb6c620d8e22a4825 -r 2c440152643c60239eb0c928132ba8f8b0aac814 yt/frontends/enzo/fields.py
--- a/yt/frontends/enzo/fields.py
+++ b/yt/frontends/enzo/fields.py
@@ -229,6 +229,13 @@
                 ("gas", "thermal_energy"),
                 function = _tot_minus_kin,
                 units = "erg/g")
+        if multi_species == 0 and 'Mu' in params:
+            def _number_density(field, data):
+                return data['gas', 'density']/(mp*params['Mu'])
+            self.add_field(
+                ("gas", "number_density"),
+                function = _number_density,
+                units="1/cm**3")
 
     def setup_particle_fields(self, ptype):

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