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

britton at wrangler.dreamhost.com britton at wrangler.dreamhost.com
Fri Oct 30 18:47:10 PDT 2009


Author: britton
Date: Fri Oct 30 18:47:09 2009
New Revision: 1510
URL: http://yt.enzotools.org/changeset/1510

Log:
Fixing it for real this time.


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:47:09 2009
@@ -255,7 +255,7 @@
         # Use minimum number of datasets to go from z_i to z_f.
         if minimal:
 
-            z_Tolerance = 1e-4
+            z_Tolerance = 1e-3
             z = initial_redshift
 
             # fill redshift space with datasets
@@ -267,13 +267,13 @@
                     # 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['redshift']:
+                            (z < current_slice['next']['redshift'] or \
+                                 na.abs(z - current_slice['next']['redshift']) < z_Tolerance):
                         current_slice = current_slice['next']
 
                     if current_slice is cosmology_splice[-1]:



More information about the yt-svn mailing list