[Yt-svn] commit/yt: 5 new changesets
Bitbucket
commits-noreply at bitbucket.org
Thu Aug 4 13:44:44 PDT 2011
5 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/5686f31651ee/
changeset: 5686f31651ee
branch: stable
user: evelee
date: 2011-08-04 19:55:07
summary: Particle Mass in _IsBound
user: Eve Lee <elee at cita.utoronto.ca>
branch 'stable'
changed yt/data_objects/derived_quantities.py
affected #: 1 file (1.1 KB)
--- a/yt/data_objects/derived_quantities.py Wed Apr 27 15:02:53 2011 -0400
+++ b/yt/data_objects/derived_quantities.py Thu Aug 04 13:55:07 2011 -0400
@@ -155,6 +155,20 @@
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.
+ Aug 2 2011 Eve Lee
+ """
+ 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)
+
def _CenterOfMass(data,use_particles=False):
"""
This function returns the location of the center
@@ -274,7 +288,7 @@
combine_function=_combBaryonSpinParameter, n_ret=4)
def _IsBound(data, truncate = True, include_thermal_energy = False,
- treecode = True, opening_angle = 1.0, periodic_test = False):
+ treecode = True, opening_angle = 1.0, periodic_test = False, include_particles = True):
r"""
This returns whether or not the object is gravitationally bound. If this
returns a value greater than one, it is bound, and otherwise not.
@@ -296,7 +310,10 @@
used to calculate the potential between masses.
periodic_test : Bool
Used for testing the periodic adjustment machinery
- of this derived quantity.
+ of this derived quantity.
+ include_particles : Bool
+ Should we add the mass contribution of particles
+ to calculate binding energy? -- Aug 2 2011 Eve Lee
Examples
--------
@@ -308,13 +325,22 @@
bv_x,bv_y,bv_z = data.quantities["BulkVelocity"]()
# One-cell objects are NOT BOUND.
if data["CellMass"].size == 1: return [0.0]
- kinetic = 0.5 * (data["CellMass"] * (
+ """
+ Changing data["CellMass"] to mass_to_use
+ Add the mass contribution of particles if include_particles = True
+ Aug 2 2011 Eve Lee
+ """
+ if (include_particles):
+ mass_to_use = data.quantities["MatterMass"]()[0]
+ else:
+ mass_to_use = data["CellMass"]
+ kinetic = 0.5 * (mass_to_use * (
(data["x-velocity"] - bv_x)**2
+ (data["y-velocity"] - bv_y)**2
+ (data["z-velocity"] - bv_z)**2 )).sum()
# Add thermal energy to kinetic energy
if (include_thermal_energy):
- thermal = (data["ThermalEnergy"] * data["CellMass"]).sum()
+ thermal = (data["ThermalEnergy"] * mass_to_use).sum()
kinetic += thermal
if periodic_test:
kinetic = na.ones_like(kinetic)
@@ -345,8 +371,11 @@
# This dict won't make a copy of the data, but it will make a copy to
# change if needed in the periodic section immediately below.
local_data = {}
- for label in ["x", "y", "z", "CellMass"]:
+ for label in ["x", "y", "z"]: # Separating CellMass from the for loop -- Aug 2 2011 Eve Lee
local_data[label] = data[label]
+ local_data["CellMass"] = mass_to_use # Adding CellMass separately -- Aug 2 2011 Eve Lee
+ # NOTE: if include_particles = True, local_data["CellMass"]
+ # is not the same as data["CellMass"]!!!
if periodic.any():
# Adjust local_data to re-center the clump to remove the periodicity
# by the gap calculated above.
@@ -401,7 +430,7 @@
thisx = (local_data["x"][sel] / dx).astype('int64') - cover_imin[0] * 2**L
thisy = (local_data["y"][sel] / dy).astype('int64') - cover_imin[1] * 2**L
thisz = (local_data["z"][sel] / dz).astype('int64') - cover_imin[2] * 2**L
- vals = na.array([local_data["CellMass"][sel]], order='F')
+ vals = na.array([local_data["CellMass"][sel]], order='F')
octree.add_array_to_tree(L, thisx, thisy, thisz, vals,
na.ones_like(thisx).astype('float64'), treecode = 1)
# Now we calculate the binding energy using a treecode.
http://bitbucket.org/yt_analysis/yt/changeset/1e3e41bc3601/
changeset: 1e3e41bc3601
branch: stable
user: evelee
date: 2011-08-04 20:16:47
summary: Mergine
user: Eve Lee <elee at cita.utoronto.ca>
branch merge
branch 'stable'
changed yt/analysis_modules/halo_mass_function/halo_mass_function.py
changed yt/funcs.py
affected #: 2 files (52 bytes)
--- a/yt/analysis_modules/halo_mass_function/halo_mass_function.py Thu Aug 04 13:55:07 2011 -0400
+++ b/yt/analysis_modules/halo_mass_function/halo_mass_function.py Thu Aug 04 14:16:47 2011 -0400
@@ -324,7 +324,7 @@
self.multiplicityfunction(thissigma)*(self.massarray[i+1] - self.massarray[i]);
# scale by h^4 to get rid of all factors of h
- dn_M_z *= math.pow(self.hubble0, 4.0);
+ dn_M_z *= math.pow(self.hubble0, 3.0);
# keep track of cumulative number density
if dn_M_z > 1.0e-20:
--- a/yt/funcs.py Thu Aug 04 13:55:07 2011 -0400
+++ b/yt/funcs.py Thu Aug 04 14:16:47 2011 -0400
@@ -124,7 +124,10 @@
"""
Returning resident size in megabytes
"""
- pagesize = resource.getpagesize()
+ try:
+ pagesize = resource.getpagesize()
+ except NameError:
+ return 0
pid = os.getpid()
status_file = "/proc/%s/statm" % (pid)
if not os.path.isfile(status_file):
http://bitbucket.org/yt_analysis/yt/changeset/969b6f842b79/
changeset: 969b6f842b79
branch: yt
user: evelee
date: 2011-08-04 19:55:07
summary: Particle Mass in _IsBound
user: Eve Lee <elee at cita.utoronto.ca>
branch 'stable'
changed yt/data_objects/derived_quantities.py
affected #: 1 file (1.1 KB)
--- a/yt/data_objects/derived_quantities.py Fri Jul 29 18:31:52 2011 -0400
+++ b/yt/data_objects/derived_quantities.py Thu Aug 04 13:55:07 2011 -0400
@@ -155,6 +155,20 @@
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.
+ Aug 2 2011 Eve Lee
+ """
+ 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)
+
def _CenterOfMass(data, use_cells=True, use_particles=False):
"""
This function returns the location of the center
@@ -297,7 +311,7 @@
combine_function=_combBaryonSpinParameter, n_ret=4)
def _IsBound(data, truncate = True, include_thermal_energy = False,
- treecode = True, opening_angle = 1.0, periodic_test = False):
+ treecode = True, opening_angle = 1.0, periodic_test = False, include_particles = True):
r"""
This returns whether or not the object is gravitationally bound. If this
returns a value greater than one, it is bound, and otherwise not.
@@ -319,7 +333,10 @@
used to calculate the potential between masses.
periodic_test : Bool
Used for testing the periodic adjustment machinery
- of this derived quantity.
+ of this derived quantity.
+ include_particles : Bool
+ Should we add the mass contribution of particles
+ to calculate binding energy? -- Aug 2 2011 Eve Lee
Examples
--------
@@ -331,13 +348,22 @@
bv_x,bv_y,bv_z = data.quantities["BulkVelocity"]()
# One-cell objects are NOT BOUND.
if data["CellMass"].size == 1: return [0.0]
- kinetic = 0.5 * (data["CellMass"] * (
+ """
+ Changing data["CellMass"] to mass_to_use
+ Add the mass contribution of particles if include_particles = True
+ Aug 2 2011 Eve Lee
+ """
+ if (include_particles):
+ mass_to_use = data.quantities["MatterMass"]()[0]
+ else:
+ mass_to_use = data["CellMass"]
+ kinetic = 0.5 * (mass_to_use * (
(data["x-velocity"] - bv_x)**2
+ (data["y-velocity"] - bv_y)**2
+ (data["z-velocity"] - bv_z)**2 )).sum()
# Add thermal energy to kinetic energy
if (include_thermal_energy):
- thermal = (data["ThermalEnergy"] * data["CellMass"]).sum()
+ thermal = (data["ThermalEnergy"] * mass_to_use).sum()
kinetic += thermal
if periodic_test:
kinetic = na.ones_like(kinetic)
@@ -368,8 +394,11 @@
# This dict won't make a copy of the data, but it will make a copy to
# change if needed in the periodic section immediately below.
local_data = {}
- for label in ["x", "y", "z", "CellMass"]:
+ for label in ["x", "y", "z"]: # Separating CellMass from the for loop -- Aug 2 2011 Eve Lee
local_data[label] = data[label]
+ local_data["CellMass"] = mass_to_use # Adding CellMass separately -- Aug 2 2011 Eve Lee
+ # NOTE: if include_particles = True, local_data["CellMass"]
+ # is not the same as data["CellMass"]!!!
if periodic.any():
# Adjust local_data to re-center the clump to remove the periodicity
# by the gap calculated above.
@@ -424,7 +453,7 @@
thisx = (local_data["x"][sel] / dx).astype('int64') - cover_imin[0] * 2**L
thisy = (local_data["y"][sel] / dy).astype('int64') - cover_imin[1] * 2**L
thisz = (local_data["z"][sel] / dz).astype('int64') - cover_imin[2] * 2**L
- vals = na.array([local_data["CellMass"][sel]], order='F')
+ vals = na.array([local_data["CellMass"][sel]], order='F')
octree.add_array_to_tree(L, thisx, thisy, thisz, vals,
na.ones_like(thisx).astype('float64'), treecode = 1)
# Now we calculate the binding energy using a treecode.
http://bitbucket.org/yt_analysis/yt/changeset/23ca77b9a6b4/
changeset: 23ca77b9a6b4
branch: yt
user: MatthewTurk
date: 2011-08-04 22:43:31
summary: Adding Eve and JC to the CREDITS list
affected #: 2 files (237 bytes)
--- a/CREDITS Thu Aug 04 13:55:07 2011 -0400
+++ b/CREDITS Thu Aug 04 16:43:31 2011 -0400
@@ -18,6 +18,8 @@
Andrew Myers (atmyers at astro.berkeley.edu)
Michael Kuhlen (mqk at astro.berkeley.edu)
Casey Stark (caseywstark at gmail.com)
+ JC Passy (jcpassy at gmail.com)
+ Eve Lee (elee at cita.utoronto.ca)
We also include the Delaunay Triangulation module written by Robert Kern of
Enthought, the cmdln.py module by Trent Mick, and the progressbar module by
--- a/yt/data_objects/derived_quantities.py Thu Aug 04 13:55:07 2011 -0400
+++ b/yt/data_objects/derived_quantities.py Thu Aug 04 16:43:31 2011 -0400
@@ -159,7 +159,6 @@
"""
This function takes no arguments and returns the array sum of cell masses
and particle masses.
- Aug 2 2011 Eve Lee
"""
cellvol = data["CellVolume"]
matter_rho = data["Matter_Density"]
@@ -336,7 +335,7 @@
of this derived quantity.
include_particles : Bool
Should we add the mass contribution of particles
- to calculate binding energy? -- Aug 2 2011 Eve Lee
+ to calculate binding energy?
Examples
--------
@@ -351,7 +350,6 @@
"""
Changing data["CellMass"] to mass_to_use
Add the mass contribution of particles if include_particles = True
- Aug 2 2011 Eve Lee
"""
if (include_particles):
mass_to_use = data.quantities["MatterMass"]()[0]
@@ -394,9 +392,9 @@
# This dict won't make a copy of the data, but it will make a copy to
# change if needed in the periodic section immediately below.
local_data = {}
- for label in ["x", "y", "z"]: # Separating CellMass from the for loop -- Aug 2 2011 Eve Lee
+ for label in ["x", "y", "z"]: # Separating CellMass from the for loop
local_data[label] = data[label]
- local_data["CellMass"] = mass_to_use # Adding CellMass separately -- Aug 2 2011 Eve Lee
+ local_data["CellMass"] = mass_to_use # Adding CellMass separately
# NOTE: if include_particles = True, local_data["CellMass"]
# is not the same as data["CellMass"]!!!
if periodic.any():
http://bitbucket.org/yt_analysis/yt/changeset/58c658033d38/
changeset: 58c658033d38
branch: stable
user: MatthewTurk
date: 2011-08-04 22:44:20
summary: Updating CREDITS file from the tip
affected #: 2 files (364 bytes)
--- a/CREDITS Thu Aug 04 14:16:47 2011 -0400
+++ b/CREDITS Thu Aug 04 16:44:20 2011 -0400
@@ -1,9 +1,9 @@
YT is a group effort.
-Developers: Matthew Turk (matthewturk at gmail.com)
+Contributors: Matthew Turk (matthewturk at gmail.com)
Britton Smith (brittonsmith at gmail.com)
Jeff Oishi (jsoishi at gmail.com)
- Stephen Skory (sskory at physics.ucsd.edu)
+ Stephen Skory (s at skory.us)
Sam Skillman (samskillman at gmail.com)
Devin Silvia (devin.silvia at gmail.com)
John Wise (jwise at astro.princeton.edu)
@@ -14,8 +14,12 @@
Chris Malone (cmalone at mail.astro.sunysb.edu)
Cameron Hummels (chummels at astro.columbia.edu)
Stefan Klemer (sklemer at phys.uni-goettingen.de)
+ Tom Abel (tabel at stanford.edu)
Andrew Myers (atmyers at astro.berkeley.edu)
- Tom Abel (tabel at stanford.edu)
+ Michael Kuhlen (mqk at astro.berkeley.edu)
+ Casey Stark (caseywstark at gmail.com)
+ JC Passy (jcpassy at gmail.com)
+ Eve Lee (elee at cita.utoronto.ca)
We also include the Delaunay Triangulation module written by Robert Kern of
Enthought, the cmdln.py module by Trent Mick, and the progressbar module by
--- a/yt/data_objects/derived_quantities.py Thu Aug 04 14:16:47 2011 -0400
+++ b/yt/data_objects/derived_quantities.py Thu Aug 04 16:44:20 2011 -0400
@@ -159,7 +159,6 @@
"""
This function takes no arguments and returns the array sum of cell masses
and particle masses.
- Aug 2 2011 Eve Lee
"""
cellvol = data["CellVolume"]
matter_rho = data["Matter_Density"]
@@ -313,7 +312,7 @@
of this derived quantity.
include_particles : Bool
Should we add the mass contribution of particles
- to calculate binding energy? -- Aug 2 2011 Eve Lee
+ to calculate binding energy?
Examples
--------
@@ -328,7 +327,6 @@
"""
Changing data["CellMass"] to mass_to_use
Add the mass contribution of particles if include_particles = True
- Aug 2 2011 Eve Lee
"""
if (include_particles):
mass_to_use = data.quantities["MatterMass"]()[0]
@@ -371,9 +369,9 @@
# This dict won't make a copy of the data, but it will make a copy to
# change if needed in the periodic section immediately below.
local_data = {}
- for label in ["x", "y", "z"]: # Separating CellMass from the for loop -- Aug 2 2011 Eve Lee
+ for label in ["x", "y", "z"]: # Separating CellMass from the for loop
local_data[label] = data[label]
- local_data["CellMass"] = mass_to_use # Adding CellMass separately -- Aug 2 2011 Eve Lee
+ local_data["CellMass"] = mass_to_use # Adding CellMass separately
# NOTE: if include_particles = True, local_data["CellMass"]
# is not the same as data["CellMass"]!!!
if periodic.any():
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