[Yt-svn] yt-commit r857 - branches/yt-1.0/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Fri Oct 31 10:05:02 PDT 2008
Author: mturk
Date: Fri Oct 31 10:05:01 2008
New Revision: 857
URL: http://yt.spacepope.org/changeset/857
Log:
Backporting a change that fixes max locations and also adds
find_max_cell_location
Modified:
branches/yt-1.0/yt/lagos/HierarchyType.py
Modified: branches/yt-1.0/yt/lagos/HierarchyType.py
==============================================================================
--- branches/yt-1.0/yt/lagos/HierarchyType.py (original)
+++ branches/yt-1.0/yt/lagos/HierarchyType.py Fri Oct 31 10:05:01 2008
@@ -646,6 +646,11 @@
"""
Returns (value, center) of location of maximum for a given field.
"""
+ mg, mc, mv, pos = self.find_max_cell_location(field, finestLevels)
+ return mv, pos
+ findMax = find_max
+
+ def find_max_cell_location(self, field, finestLevels = True):
if finestLevels:
gI = na.where(self.gridLevels >= self.maxLevel - NUMTOCHECK)
else:
@@ -660,9 +665,6 @@
maxGrid = grid
mc = na.array(maxCoord)
pos=maxGrid.get_position(mc)
- pos[0] += 0.5*maxGrid.dx
- pos[1] += 0.5*maxGrid.dx
- pos[2] += 0.5*maxGrid.dx
mylog.info("Max Value is %0.5e at %0.16f %0.16f %0.16f in grid %s at level %s %s", \
maxVal, pos[0], pos[1], pos[2], maxGrid, maxGrid.Level, mc)
self.center = pos
@@ -672,7 +674,7 @@
maxGrid["z-velocity"][maxCoord])
self.parameters["Max%sValue" % (field)] = maxVal
self.parameters["Max%sPos" % (field)] = "%s" % (pos)
- return maxVal, pos
+ return maxGrid, maxCoord, maxVal, pos
findMax = find_max
More information about the yt-svn
mailing list