[yt-svn] commit/yt: 3 new changesets
Bitbucket
commits-noreply at bitbucket.org
Mon Nov 21 05:19:19 PST 2011
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/6467a4ca9c30/
changeset: 6467a4ca9c30
branch: yt
user: brittonsmith
date: 2011-11-20 21:56:33
summary: Added ckdtree.c to .hgignore.
affected #: 1 file
diff -r a9d0a3e89a5994dcaa63ab876051b160025a79a2 -r 6467a4ca9c30b6bd831128d032409c7fc9aad8ce .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -8,6 +8,7 @@
yt/utilities/amr_utils.c
yt/utilities/kdtree/forthonf2c.h
yt/utilities/libconfig_wrapper.c
+yt/utilities/spatial/ckdtree.c
syntax: glob
*.pyc
.*.swp
https://bitbucket.org/yt_analysis/yt/changeset/1d2198919d6e/
changeset: 1d2198919d6e
branch: yt
user: brittonsmith
date: 2011-11-21 00:14:53
summary: Removed MatterMass derived quantity since it was acting like a
field and added a TotalMass (there is already a TotalMassMsun field)
field (units of grams) to be used with the clump finder. Also, refactored
the TotalMass dervied quantity to be a little simpler.
affected #: 2 files
diff -r 6467a4ca9c30b6bd831128d032409c7fc9aad8ce -r 1d2198919d6e8b6f8c7770a3a2db521e1d3a3aac yt/data_objects/derived_quantities.py
--- a/yt/data_objects/derived_quantities.py
+++ b/yt/data_objects/derived_quantities.py
@@ -151,24 +151,11 @@
"""
baryon_mass = data["CellMassMsun"].sum()
particle_mass = data["ParticleMassMsun"].sum()
- return baryon_mass, particle_mass
-def _combTotalMass(data, baryon_mass, particle_mass):
- return baryon_mass.sum() + particle_mass.sum()
+ return [baryon_mass + particle_mass]
+def _combTotalMass(data, total_mass):
+ return total_mass.sum()
add_quantity("TotalMass", function=_TotalMass,
- combine_function=_combTotalMass, n_ret = 2)
-
-def _MatterMass(data):
- """
- This function takes no arguments and returns the array sum of cell masses
- and particle masses.
- """
- cellvol = data["CellVolume"]
- matter_rho = data["Matter_Density"]
- return cellvol, matter_rho
-def _combMatterMass(data, cellvol, matter_rho):
- return cellvol*matter_rho
-add_quantity("MatterMass", function=_MatterMass,
- combine_function=_combMatterMass, n_ret=2)
+ combine_function=_combTotalMass, n_ret=1)
def _CenterOfMass(data, use_cells=True, use_particles=False):
"""
@@ -358,7 +345,7 @@
Add the mass contribution of particles if include_particles = True
"""
if (include_particles):
- mass_to_use = data.quantities["MatterMass"]()[0]
+ mass_to_use = data["TotalMass"]
else:
mass_to_use = data["CellMass"]
kinetic = 0.5 * (mass_to_use * (
diff -r 6467a4ca9c30b6bd831128d032409c7fc9aad8ce -r 1d2198919d6e8b6f8c7770a3a2db521e1d3a3aac yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -30,8 +30,6 @@
import inspect
import copy
-from math import pi
-
from yt.funcs import *
from yt.utilities.amr_utils import CICDeposit_3, obtain_rvec
@@ -266,7 +264,7 @@
M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
Note that we return in our natural units already
"""
- return (3.0*pi/(16*G*data["Density"]))**(1./2.)
+ return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
add_field("DynamicalTime", function=_DynamicalTime,
units=r"\rm{s}")
@@ -295,6 +293,7 @@
def _TotalMass(field,data):
return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
+add_field("TotalMass", function=_TotalMass, units=r"\rm{g}")
add_field("TotalMassMsun", units=r"M_{\odot}",
function=_TotalMass,
convert_function=_convertCellMassMsun)
https://bitbucket.org/yt_analysis/yt/changeset/d13229785f3c/
changeset: d13229785f3c
branch: yt
user: brittonsmith
date: 2011-11-21 01:16:19
summary: Merged.
affected #: 1 file
diff -r 1d2198919d6e8b6f8c7770a3a2db521e1d3a3aac -r d13229785f3cc8c21eb5c68c143b63330050b62c yt/analysis_modules/level_sets/clump_handling.py
--- a/yt/analysis_modules/level_sets/clump_handling.py
+++ b/yt/analysis_modules/level_sets/clump_handling.py
@@ -35,6 +35,7 @@
function=None, clump_info=None):
self.parent = parent
self.data = data
+ self.quantities = data.quantities
self.field = field
self.min_val = self.data[field].min()
self.max_val = self.data[field].max()
@@ -167,6 +168,7 @@
# unreliable in the unpickling
for child in children: child.parent = obj
obj.data = data[1] # Strip out the PF
+ obj.quantities = obj.data.quantities
if obj.parent is None: return (data[0], obj)
return obj
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