[Yt-svn] yt-commit r1596 - in branches/yt-1.6/yt: extensions lagos raven

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Mon Jan 25 21:06:45 PST 2010


Author: mturk
Date: Mon Jan 25 21:06:44 2010
New Revision: 1596
URL: http://yt.enzotools.org/changeset/1596

Log:
Backporting from trunk the halo mass function fixes from Stephen, the Particle
IO function fix, the zlim changes and the fixes for displaying unit boxes.



Modified:
   branches/yt-1.6/yt/extensions/HaloMassFcn.py
   branches/yt-1.6/yt/lagos/ParticleIO.py
   branches/yt-1.6/yt/raven/Callbacks.py
   branches/yt-1.6/yt/raven/PlotCollection.py

Modified: branches/yt-1.6/yt/extensions/HaloMassFcn.py
==============================================================================
--- branches/yt-1.6/yt/extensions/HaloMassFcn.py	(original)
+++ branches/yt-1.6/yt/extensions/HaloMassFcn.py	Mon Jan 25 21:06:44 2010
@@ -101,8 +101,10 @@
             self.hubble0 = self.pf['CosmologyHubbleConstantNow']
             self.this_redshift = self.pf['CosmologyCurrentRedshift']
             self.read_haloes()
-            self.log_mass_min = math.log10(min(self.haloes))
-            self.log_mass_max = math.log10(max(self.haloes))
+            if self.log_mass_min == None:
+                self.log_mass_min = math.log10(min(self.haloes))
+            if self.log_mass_max == None:
+                self.log_mass_max = math.log10(max(self.haloes))
 
         # Input error check.
         if self.mode == 'single':
@@ -392,7 +394,7 @@
         
         if self.fitting_function==1:
             # Press-Schechter (This form from Jenkins et al. 2001, MNRAS 321, 372-384, eqtn. 5)
-            thismult = sqrt(2.0/math.pi) * nu * exp(-0.5*nu*nu);
+            thismult = math.sqrt(2.0/math.pi) * nu * math.exp(-0.5*nu*nu);
         
         elif self.fitting_function==2:
             # Jenkins et al. 2001, MNRAS 321, 372-384, eqtn. 9

Modified: branches/yt-1.6/yt/lagos/ParticleIO.py
==============================================================================
--- branches/yt-1.6/yt/lagos/ParticleIO.py	(original)
+++ branches/yt-1.6/yt/lagos/ParticleIO.py	Mon Jan 25 21:06:44 2010
@@ -94,7 +94,7 @@
             else:
                 func = f.particle_convert
             conv_factors.append(
-              na.fromiter((f.particle_convert(g) for g in grid_list),
+              na.fromiter((func(g) for g in grid_list),
                           count=len(grid_list), dtype='float64'))
         conv_factors = na.array(conv_factors).transpose()
         self.conv_factors = conv_factors

Modified: branches/yt-1.6/yt/raven/Callbacks.py
==============================================================================
--- branches/yt-1.6/yt/raven/Callbacks.py	(original)
+++ branches/yt-1.6/yt/raven/Callbacks.py	Mon Jan 25 21:06:44 2010
@@ -315,7 +315,7 @@
                    ( (right_edge_py < height) & (left_edge_py > 0) )
         verts=verts.transpose()[visible,:,:]
         grid_collection = matplotlib.collections.PolyCollection(
-                verts, facecolors=(0.0,0.0,0.0,0.0),
+                verts, facecolors="none",
                        edgecolors=(0.0,0.0,0.0,1.0),
                        linewidths=2.5)
         plot._axes.hold(True)

Modified: branches/yt-1.6/yt/raven/PlotCollection.py
==============================================================================
--- branches/yt-1.6/yt/raven/PlotCollection.py	(original)
+++ branches/yt-1.6/yt/raven/PlotCollection.py	Mon Jan 25 21:06:44 2010
@@ -103,7 +103,7 @@
         for plot in self.plots:
             plot.set_ylim(ymin, ymax)
 
-    def set_zlim(self, zmin, zmax, **kwargs):
+    def set_zlim(self, zmin, zmax, *args, **kwargs):
         """
         Set the limits of the colorbar. 'min' or 'max' are possible inputs 
         when combined with dex=value, where value gives the maximum number of 
@@ -119,7 +119,7 @@
         """
         for plot in self.plots:
             plot.set_autoscale(False)
-            plot.set_zlim(zmin, zmax, **kwargs)
+            plot.set_zlim(zmin, zmax, *args, **kwargs)
 
     def set_lim(self, lim):
         """



More information about the yt-svn mailing list