[Yt-svn] yt-commit r885 - trunk/yt/lagos/hop
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Wed Nov 5 12:36:04 PST 2008
Author: mturk
Date: Wed Nov 5 12:36:03 2008
New Revision: 885
URL: http://yt.spacepope.org/changeset/885
Log:
Added an optional normalize_to parameter in the HOP stuff, which I think might
fix some problems with the halo counts in parallel
Modified:
trunk/yt/lagos/hop/EnzoHop.c
trunk/yt/lagos/hop/HopOutput.py
Modified: trunk/yt/lagos/hop/EnzoHop.c
==============================================================================
--- trunk/yt/lagos/hop/EnzoHop.c (original)
+++ trunk/yt/lagos/hop/EnzoHop.c Wed Nov 5 12:36:03 2008
@@ -47,13 +47,14 @@
PyArrayObject *xpos, *ypos, *zpos,
*mass;
xpos=ypos=zpos=mass=NULL;
- npy_float64 totalmass = 0;
+ npy_float64 totalmass = 0.0;
+ float normalize_to = 1.0;
float thresh = 160.0;
int i;
- if (!PyArg_ParseTuple(args, "OOOO|f",
- &oxpos, &oypos, &ozpos, &omass, &thresh))
+ if (!PyArg_ParseTuple(args, "OOOO|ff",
+ &oxpos, &oypos, &ozpos, &omass, &thresh, &normalize_to))
return PyErr_Format(_HOPerror,
"EnzoHop: Invalid parameters.");
@@ -98,6 +99,7 @@
for(i = 0; i < num_particles; i++)
totalmass+=*(npy_float64*)PyArray_GETPTR1(mass,i);
+ totalmass /= normalize_to;
/* initialize the kd hop structure */
Modified: trunk/yt/lagos/hop/HopOutput.py
==============================================================================
--- trunk/yt/lagos/hop/HopOutput.py (original)
+++ trunk/yt/lagos/hop/HopOutput.py Wed Nov 5 12:36:03 2008
@@ -179,7 +179,7 @@
self.particle_fields["particle_position_y"],
self.particle_fields["particle_position_z"],
self.particle_fields["ParticleMassMsun"],
- self.threshold)
+ self.threshold, 1.0)
self.particle_fields["densities"] = self.densities
self.particle_fields["tags"] = self.tags
More information about the yt-svn
mailing list