[Yt-svn] yt-commit r1509 - trunk/yt/extensions

britton at wrangler.dreamhost.com britton at wrangler.dreamhost.com
Fri Oct 30 18:13:45 PDT 2009


Author: britton
Date: Fri Oct 30 18:13:45 2009
New Revision: 1509
URL: http://yt.enzotools.org/changeset/1509

Log:
Fixed bug in create_cosmology_splice.


Modified:
   trunk/yt/extensions/EnzoSimulation.py

Modified: trunk/yt/extensions/EnzoSimulation.py
==============================================================================
--- trunk/yt/extensions/EnzoSimulation.py	(original)
+++ trunk/yt/extensions/EnzoSimulation.py	Fri Oct 30 18:13:45 2009
@@ -258,25 +258,22 @@
             z_Tolerance = 1e-4
             z = initial_redshift
 
-            b = 0
-
             # fill redshift space with datasets
             while ((z > final_redshift) and 
                    (na.fabs(z - final_redshift) > z_Tolerance)):
 
-                b += 1
-
                 # For first data dump, choose closest to desired redshift.
                 if (len(cosmology_splice) == 0):
                     # Sort data outputs by proximity to current redsfhit.
                     self.allOutputs.sort(key=lambda obj:na.fabs(z - obj['redshift']))
                     cosmology_splice.append(self.allOutputs[0])
+                    print "Adding slice at z = %f." % cosmology_splice[-1]['redshift']
 
                 # Move forward from last slice in stack until z > z_max.
                 else:
                     current_slice = cosmology_splice[-1]
-                    while (current_slice['next'] is not None and
-                           z <= current_slice['next']['redshift']):
+                    while current_slice['next'] is not None and \
+                            z < current_slice['redshift']:
                         current_slice = current_slice['next']
 
                     if current_slice is cosmology_splice[-1]:



More information about the yt-svn mailing list