[yt-svn] commit/yt-3.0: MatthewTurk: A few minor updates for GadgetHDF5 data.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Oct 22 18:34:49 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/4c112d5ad497/
Changeset:   4c112d5ad497
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-10-22 23:47:37
Summary:     A few minor updates for GadgetHDF5 data.
Affected #:  3 files

diff -r ec501e2b7d686ac302ee463d87a8a115eb46284f -r 4c112d5ad497f5f4c000530939d03ed4dde34cc1 yt/frontends/sph/data_structures.py
--- a/yt/frontends/sph/data_structures.py
+++ b/yt/frontends/sph/data_structures.py
@@ -128,7 +128,8 @@
             function = TranslationFunc((ptype, "ParticleIDs")),
             particle_type = True)
         standard_particle_fields(self.field_info, ptype)
-        _setup_particle_fields(self.field_info, ptype)
+        _setup_particle_fields(self.field_info, ptype,
+            self._particle_mass_name)
         return [n for n, v in set(self.field_info.items()).difference(orig)]
 
 class GadgetStaticOutput(ParticleStaticOutput):
@@ -286,6 +287,7 @@
     _file_class = ParticleFile
     _fieldinfo_fallback = GadgetHDF5FieldInfo
     _fieldinfo_known = KnownGadgetHDF5Fields
+    _particle_mass_name = "Masses"
     _suffix = ".hdf5"
 
     def __init__(self, filename, data_style="gadget_hdf5", 

diff -r ec501e2b7d686ac302ee463d87a8a115eb46284f -r 4c112d5ad497f5f4c000530939d03ed4dde34cc1 yt/frontends/sph/fields.py
--- a/yt/frontends/sph/fields.py
+++ b/yt/frontends/sph/fields.py
@@ -66,11 +66,8 @@
         return data.convert(cf)
     return _convert
 
-# TIPSY
-# =====
-
-def _setup_particle_fields(registry, ptype):
-    registry.add_field((ptype, "Mass"), function=NullFunc,
+def _setup_particle_fields(registry, ptype, mass_name = "Mass"):
+    registry.add_field((ptype, mass_name), function=NullFunc,
         particle_type = True,
         convert_function=_get_conv("mass"),
         units = r"\mathrm{g}")
@@ -80,7 +77,7 @@
         units = r"\mathrm{cm}/\mathrm{s}")
     # Note that we have to do this last so that TranslationFunc operates
     # correctly.
-    particle_deposition_functions(ptype, "Coordinates", "Mass",
+    particle_deposition_functions(ptype, "Coordinates", mass_name,
                                   registry)
     particle_scalar_functions(ptype, "Coordinates", "Velocities",
                               registry)

diff -r ec501e2b7d686ac302ee463d87a8a115eb46284f -r 4c112d5ad497f5f4c000530939d03ed4dde34cc1 yt/frontends/sph/io.py
--- a/yt/frontends/sph/io.py
+++ b/yt/frontends/sph/io.py
@@ -94,7 +94,7 @@
                 del coords
                 if mask is None: continue
                 for field in field_list:
-                    if field in ("Mass", "Mass") and \
+                    if field in ("Mass", "Masses") and \
                         ptype not in self.var_mass:
                         data = np.empty(mask.sum(), dtype="float64")
                         ind = self._known_ptypes.index(ptype)

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

--

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