[yt-svn] commit/yt: jzuhone: Added eint, ener, flam, and particle_tag to KnownFLASHFields.

Bitbucket commits-noreply at bitbucket.org
Wed Jan 18 14:11:59 PST 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/92dfa5b8e574/
changeset:   92dfa5b8e574
branch:      yt
user:        jzuhone
date:        2012-01-18 23:09:18
summary:     Added eint,ener,flam,and particle_tag to KnownFLASHFields.

Some "take_log"s for the known fields were set incorrectly (by me).

Making sure subscripted names appear correctly in plots.
affected #:  1 file

diff -r cd9537a4ef6e4b8f1fdeade05b220190b9400e6d -r 92dfa5b8e574eb291f94b6a3e9d23a55148019e7 yt/frontends/flash/fields.py
--- a/yt/frontends/flash/fields.py
+++ b/yt/frontends/flash/fields.py
@@ -84,7 +84,8 @@
                     "H2II_Fraction": "htwp",
                     "DI_Fraction": "deut",
                     "DII_Fraction": "dplu",
-                    "ParticleMass": "particle_mass"}
+                    "ParticleMass": "particle_mass",
+                    "Flame_Fraction": "flam"}
 
 def _get_density(fname):
     def _dens(field, data):
@@ -94,7 +95,8 @@
 for fn1, fn2 in translation_dict.items():
     if fn1.endswith("_Fraction"):
         add_field(fn1.split("_")[0] + "_Density",
-                  function=_get_density(fn1), take_log=True)
+                  function=_get_density(fn1), take_log=True,
+                  display_name="%s\/Density" % fn1.split("_")[0])
 
 def _get_convert(fname):
     def _conv(data):
@@ -113,6 +115,12 @@
 add_flash_field("velz", function=NullFunc, take_log=False,
                 convert_function=_get_convert("velz"),
                 units=r"\rm{cm}/\rm{s}")
+add_flash_field("ener", function=NullFunc, take_log=True,
+                convert_function=_get_convert("ener"),
+                units=r"\rm{erg}/\rm{g}")
+add_flash_field("eint", function=NullFunc, take_log=True,
+                convert_function=_get_convert("eint"),
+                units=r"\rm{erg}/\rm{g}")
 add_flash_field("particle_posx", function=NullFunc, take_log=False,
                 convert_function=_get_convert("particle_posx"),
                 units=r"\rm{cm}")
@@ -131,6 +139,8 @@
 add_flash_field("particle_velz", function=NullFunc, take_log=False,
                 convert_function=_get_convert("particle_velz"),
                 units=r"\rm{cm}/\rm{s}")
+add_flash_field("particle_tag", function=NullFunc, take_log=False,
+                convert_function=_get_convert("particle_tag"))
 add_flash_field("particle_mass", function=NullFunc, take_log=False,
                 convert_function=_get_convert("particle_mass"),
                 units=r"\rm{g}")
@@ -155,21 +165,23 @@
 add_flash_field("magp", function=NullFunc, take_log=True,
                 convert_function=_get_convert("magp"),
                 units = r"\rm{erg}\//\/\rm{cm}^{3}")
-add_flash_field("divb", function=NullFunc, take_log=True,
+add_flash_field("divb", function=NullFunc, take_log=False,
                 convert_function=_get_convert("divb"),
                 units = r"\mathrm{Gau\ss}\/\rm{cm}")
-add_flash_field("game", function=NullFunc, take_log=True,
+add_flash_field("game", function=NullFunc, take_log=False,
                 convert_function=_get_convert("game"),
                 units=r"\rm{ratio\/of\/specific\/heats}")
-add_flash_field("gamc", function=NullFunc, take_log=True,
+add_flash_field("gamc", function=NullFunc, take_log=False,
                 convert_function=_get_convert("gamc"),
                 units=r"\rm{ratio\/of\/specific\/heats}")
-add_flash_field("gpot", function=NullFunc, take_log=True,
+add_flash_field("gpot", function=NullFunc, take_log=False,
                 convert_function=_get_convert("gpot"),
                 units=r"\rm{ergs\//\/g}")
 add_flash_field("gpol", function=NullFunc, take_log=False,
                 convert_function=_get_convert("gpol"),
                 units = r"\rm{ergs\//\/g}")
+add_flash_field("flam", function=NullFunc, take_log=False,
+                convert_function=_get_convert("flam"))
 
 for f,v in translation_dict.items():
     if v not in KnownFLASHFields:
@@ -178,10 +190,14 @@
                   validators = [ValidateDataField(v)],
                   particle_type = pfield)
     else:
+        if f.endswith("_Fraction") :
+            dname = "%s\/Fraction" % f.split("_")[0]
+        else :
+            dname = f                    
         ff = KnownFLASHFields[v]
         add_field(f, TranslationFunc(v),
                   take_log=KnownFLASHFields[v].take_log,
-                  units = ff._units)
+                  units = ff._units, display_name=dname)
 
 def _convertParticleMassMsun(data):
     return 1.0/1.989e33

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