[yt-svn] commit/yt-3.0: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jun 13 11:39:24 PDT 2013
2 new commits in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/f78e2f4c831a/
Changeset: f78e2f4c831a
Branch: yt-3.0
User: MatthewTurk
Date: 2013-06-13 19:43:17
Summary: Adding particle_position_* to universal_fields.py to make them recognizable as
particle fields. Fixes #592.
Affected #: 1 file
diff -r 6f22f08f086adad2954c0efecd766713008bc66e -r f78e2f4c831aaa9707f2d71ab18963b9ac53cb47 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -940,6 +940,13 @@
add_field("JeansMassMsun",function=_JeansMassMsun,
units=r"\rm{M_{\odot}}")
+# We add these fields so that the field detector can use them
+for field in ["particle_position_%s" % ax for ax in "xyz"]:
+ # This marker should let everyone know not to use the fields, but NullFunc
+ # should do that, too.
+ add_field(field, function=NullFunc, particle_type = True,
+ units=r"UNDEFINED")
+
def _pdensity(field, data):
blank = np.zeros(data.ActiveDimensions, dtype='float64')
if data["particle_position_x"].size == 0: return blank
https://bitbucket.org/yt_analysis/yt-3.0/commits/958e5e2c321e/
Changeset: 958e5e2c321e
Branch: yt-3.0
User: MatthewTurk
Date: 2013-06-13 19:52:39
Summary: Switching TotalMass to use particle_density.
Affected #: 1 file
diff -r f78e2f4c831aaa9707f2d71ab18963b9ac53cb47 -r 958e5e2c321e930877cd3b554a979ec16213742e yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -395,7 +395,7 @@
convert_function=_convertCellMassCode)
def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
+ return (data["Density"]+data["particle_density"]) * data["CellVolume"]
add_field("TotalMass", function=_TotalMass, units=r"\rm{g}")
add_field("TotalMassMsun", units=r"M_{\odot}",
function=_TotalMass,
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