[Yt-svn] yt-commit r1088 - trunk/yt/extensions/lightcone

britton at wrangler.dreamhost.com britton at wrangler.dreamhost.com
Wed Jan 7 19:51:43 PST 2009


Author: britton
Date: Wed Jan  7 19:51:43 2009
New Revision: 1088
URL: http://yt.spacepope.org/changeset/1088

Log:
Fixed bug in light cone solution rerandomizer.  The pf object of the last 
light cone slice is kept open for use with plotting the final slice.  A 
reference to this is stored within the light cone solution.  During 
non-recycling rerandomizations, the solution is copied to another location 
so it can be compared with the new one using copy.deepcopy.  Trying to deepcopy 
the reference to the pf object that was still in there was causing the error.  
All better now.


Modified:
   trunk/yt/extensions/lightcone/LightCone.py

Modified: trunk/yt/extensions/lightcone/LightCone.py
==============================================================================
--- trunk/yt/extensions/lightcone/LightCone.py	(original)
+++ trunk/yt/extensions/lightcone/LightCone.py	Wed Jan  7 19:51:43 2009
@@ -185,7 +185,7 @@
             self.lightConeSolution[q]['ProjectionAxis'] = rand.randint(0,2)
             self.lightConeSolution[q]['ProjectionCenter'] = [rand.random(),rand.random(),rand.random()]
 
-        # Store this as the mast solution.
+        # Store this as the master solution.
         self.masterSolution = [copy.deepcopy(q) for q in self.lightConeSolution]
 
         # Clear out some stuff.
@@ -304,6 +304,11 @@
         # Get rid of old halo mask, if one was there.
         self.haloMask = []
 
+        # Clean pf objects out of light cone solution.
+        for slice in self.lightConeSolution:
+            if slice.has_key('object'):
+                del slice['object']
+
         if recycle:
             if self.verbose: mylog.info("Recycling solution made with %s with new seed %s." % (self.lightConeParameters['RandomSeed'],
                                                                               newSeed))
@@ -360,7 +365,7 @@
             commonVolume += commonNVolume(oldCube,newCube,periodic=na.array([[0,1],[0,1],[0,1]]))
             totalVolume += output['DepthBoxFraction'] * output['WidthBoxFraction']**2
 
-            # Replaces centers for every axis except the line of sight axis.
+            # Replace centers for every axis except the line of sight axis.
             for w in range(len(newCenter)):
                 if not(recycle and (w == self.lightConeSolution[q]['ProjectionAxis'])):
                     self.lightConeSolution[q]['ProjectionCenter'][w] = newCenter[w]



More information about the yt-svn mailing list