[Yt-svn] yt-commit r1078 - in branches/yt-object-serialization: . scripts yt yt/enki yt/enki/mes yt/extensions yt/extensions/lightcone yt/fido yt/lagos yt/lagos/hop yt/raven yt/raven/deliveration yt/reason

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Tue Jan 6 20:40:23 PST 2009


Author: mturk
Date: Tue Jan  6 20:40:20 2009
New Revision: 1078
URL: http://yt.spacepope.org/changeset/1078

Log:
Merging bug fixes back from trunk


Modified:
   branches/yt-object-serialization/   (props changed)
   branches/yt-object-serialization/scripts/iyt
   branches/yt-object-serialization/setup.py
   branches/yt-object-serialization/yt/commands.py
   branches/yt-object-serialization/yt/enki/mes/setup.py
   branches/yt-object-serialization/yt/enki/setup.py
   branches/yt-object-serialization/yt/extensions/HaloProfiler.py
   branches/yt-object-serialization/yt/extensions/HierarchySubset.py
   branches/yt-object-serialization/yt/extensions/lightcone/LightCone.py
   branches/yt-object-serialization/yt/extensions/lightcone/LightConeProjection.py
   branches/yt-object-serialization/yt/extensions/setup.py
   branches/yt-object-serialization/yt/fido/setup.py
   branches/yt-object-serialization/yt/funcs.py
   branches/yt-object-serialization/yt/lagos/BaseDataTypes.py
   branches/yt-object-serialization/yt/lagos/DerivedQuantities.py
   branches/yt-object-serialization/yt/lagos/HierarchyType.py
   branches/yt-object-serialization/yt/lagos/ParallelTools.py
   branches/yt-object-serialization/yt/lagos/PointCombine.c
   branches/yt-object-serialization/yt/lagos/Profiles.py
   branches/yt-object-serialization/yt/lagos/hop/HopOutput.py
   branches/yt-object-serialization/yt/lagos/hop/SS_HopOutput.py
   branches/yt-object-serialization/yt/lagos/hop/setup.py
   branches/yt-object-serialization/yt/lagos/setup.py
   branches/yt-object-serialization/yt/mods.py
   branches/yt-object-serialization/yt/raven/Callbacks.py
   branches/yt-object-serialization/yt/raven/ColorMaps.py
   branches/yt-object-serialization/yt/raven/deliveration/setup.py
   branches/yt-object-serialization/yt/raven/setup.py
   branches/yt-object-serialization/yt/reason/setup.py
   branches/yt-object-serialization/yt/setup.py

Modified: branches/yt-object-serialization/scripts/iyt
==============================================================================
--- branches/yt-object-serialization/scripts/iyt	(original)
+++ branches/yt-object-serialization/scripts/iyt	Tue Jan  6 20:40:20 2009
@@ -158,7 +158,7 @@
 def do_pfall(self, arg):
     if arg.strip() == "": arg = 0
     for i in range(int(arg)+1):
-        for f in glob.glob("".join(["*/"]*i) + "*.hierarchy" ):
+        for f in sorted(glob.glob("".join(["*/"]*i) + "*.hierarchy" )):
             #print i, f
             fn = f[:-10]
             # Make this a bit smarter

Modified: branches/yt-object-serialization/setup.py
==============================================================================
--- branches/yt-object-serialization/setup.py	(original)
+++ branches/yt-object-serialization/setup.py	Tue Jan  6 20:40:20 2009
@@ -24,6 +24,7 @@
                        quiet=True)
     
     config.make_config_py()
+    config.make_svn_version_py()
     config.add_subpackage('yt','yt')
     config.add_scripts("scripts/*")
 

Modified: branches/yt-object-serialization/yt/commands.py
==============================================================================

Modified: branches/yt-object-serialization/yt/enki/mes/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/enki/mes/setup.py	(original)
+++ branches/yt-object-serialization/yt/enki/mes/setup.py	Tue Jan  6 20:40:20 2009
@@ -5,4 +5,5 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('mes',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     return config

Modified: branches/yt-object-serialization/yt/enki/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/enki/setup.py	(original)
+++ branches/yt-object-serialization/yt/enki/setup.py	Tue Jan  6 20:40:20 2009
@@ -5,5 +5,6 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('enki',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     config.add_subpackage("mes")
     return config

Modified: branches/yt-object-serialization/yt/extensions/HaloProfiler.py
==============================================================================
--- branches/yt-object-serialization/yt/extensions/HaloProfiler.py	(original)
+++ branches/yt-object-serialization/yt/extensions/HaloProfiler.py	Tue Jan  6 20:40:20 2009
@@ -32,7 +32,7 @@
 import tables as h5
 
 class HaloProfiler(object):
-    def __init__(self,dataset,HaloProfilerParameterFile):
+    def __init__(self,dataset,HaloProfilerParameterFile,halos='multiple',radius=0.1):
         self.dataset = dataset
         self.HaloProfilerParameterFile = HaloProfilerParameterFile
         self.haloProfilerParameters = {}
@@ -41,6 +41,17 @@
         self.hopHalos = []
         self.virialQuantities = []
 
+        # Set option to get halos from hop or single halo at density maximum.
+        # multiple: get halos from hop
+        # single: get single halo from density maximum
+        self.halos = halos
+        if not(self.halos is 'multiple' or self.halos is 'single'):
+            mylog.error("Keyword, halos, must be either 'single' or 'multiple'.")
+            return
+
+        if self.halos is 'single':
+            self.haloRadius = radius
+
         # Set some parameter defaults.
         self._SetParameterDefaults()
 
@@ -53,8 +64,19 @@
     def makeProfiles(self):
         "Make radial profiles for all halos on the list."
 
-        # Get hop data.
-        self._LoadHopData()
+        # Get halo(s).
+        if self.halos is 'single':
+            v, center = self.pf.h.find_max('Density')
+            singleHalo = {}
+            singleHalo['center'] = center
+            singleHalo['r_max'] = self.haloRadius
+            self.hopHalos.append(singleHalo)
+        elif self.halos is 'multiple':
+            # Get hop data.
+            self._LoadHopData()
+        else:
+            mylog.error("I don't know whether to get halos from hop or from density maximum.  This should not have happened.")
+            return
 
         # Add profile fields necessary for calculating virial quantities.
         self._CheckForNeededProfileFields()

Modified: branches/yt-object-serialization/yt/extensions/HierarchySubset.py
==============================================================================
--- branches/yt-object-serialization/yt/extensions/HierarchySubset.py	(original)
+++ branches/yt-object-serialization/yt/extensions/HierarchySubset.py	Tue Jan  6 20:40:20 2009
@@ -47,7 +47,8 @@
         self.dx = pf.h.select_grids(level)[0].dx
         dims = (self.RightEdge-self.LeftEdge)/self.dx
         self.ActiveDimensions = dims
-        self.cg = pf.h.covering_grid(level, self.LeftEdge, self.RightEdge, dims)
+        self.cg = pf.h.smoothed_covering_grid(level, self.LeftEdge,
+                        self.RightEdge, dims=dims)
 
     def __getitem__(self, field):
         return self.cg[field]
@@ -113,17 +114,23 @@
         grid_node._v_attrs.ghostzoneFlags = na.zeros(6, dtype='int32')
         grid_node._v_attrs.numGhostzones = na.zeros(3, dtype='int32')
         grid_node._v_attrs.dims = grid.ActiveDimensions[::-1].astype('int32')
-        if grid.hierarchy.data_style == 6 and field in grid.hierarchy.field_list:
-            tfn = os.path.abspath(afile.filename)
-            gfn = os.path.abspath(grid.filename)
-            fpn = os.path.commonprefix([tfn, grid.filename])
-            fn = grid.filename[len(os.path.commonprefix([tfn, grid.filename])):]
-            grid_node._v_attrs.referenceFileName = fn
-            grid_node._v_attrs.referenceDataPath = \
-                "/Grid%08i/%s" % (grid.id, field)
+        if self.pf.h.data_style == 6 and field in self.pf.h.field_list:
+            if grid.hierarchy.data_style == -1: # constructed grid
+                # if we can get conversion in amira we won't need to do this
+                ff = grid[field]
+                ff /= self.pf.conversion_factors.get(field, 1.0)
+                afile.createArray(grid_node, "grid-data", ff.swapaxes(0,2))
+            else:
+                tfn = os.path.abspath(afile.filename)
+                gfn = os.path.abspath(grid.filename)
+                fpn = os.path.commonprefix([tfn, grid.filename])
+                fn = grid.filename[len(os.path.commonprefix([tfn, grid.filename])):]
+                grid_node._v_attrs.referenceFileName = fn
+                grid_node._v_attrs.referenceDataPath = \
+                    "/Grid%08i/%s" % (grid.id, field)
         else:
             # Export our array
-            afile.createArray(grid_node, "grid-data", grid[field])
+            afile.createArray(grid_node, "grid-data", grid[field].swapaxes(0,2))
 
 def __get_pf(bn, n):
     bn_try = "%s%04i" % (bn, n)
@@ -145,7 +152,7 @@
                       help="The maximum level to extract (chooses first grid at that level)")
     parser.add_option("-d","--subtract-time", action="store_true",
                       dest="subtract_time", help="Subtract the physical time of " + \
-                        "the first timestep (useful for small delta t)")
+                      "the first timestep (useful for small delta t)", default=False)
     parser.add_option("-r","--recenter", action="store_true",
                       dest="recenter", help="Recenter on maximum density in final output")
     parser.usage = "%prog [options] FIRST_ID LAST_ID"

Modified: branches/yt-object-serialization/yt/extensions/lightcone/LightCone.py
==============================================================================
--- branches/yt-object-serialization/yt/extensions/lightcone/LightCone.py	(original)
+++ branches/yt-object-serialization/yt/extensions/lightcone/LightCone.py	Tue Jan  6 20:40:20 2009
@@ -209,7 +209,7 @@
                 self.haloMask *= mask
             del haloMaskCube
 
-    def ProjectLightCone(self,field,weight_field=None,apply_halo_mask=False,save_stack=True,save_slice_images=False,**kwargs):
+    def ProjectLightCone(self,field,weight_field=None,apply_halo_mask=False,node=None,save_stack=True,save_slice_images=False,**kwargs):
         "Create projections for light cone, then add them together."
 
         # Clear projection stack.
@@ -227,7 +227,7 @@
             output['object'] = lagos.EnzoStaticOutput(output['filename'])
             frb = LightConeProjection(output,field,self.pixels,weight_field=weight_field,
                                       save_image=save_slice_images,
-                                      name=name,**kwargs)
+                                      name=name,node=node,**kwargs)
             if ytcfg.getint("yt","__parallel_rank") == 0:
                 if (weight_field is not None):
                     # Data come back normalized by the weight field.

Modified: branches/yt-object-serialization/yt/extensions/lightcone/LightConeProjection.py
==============================================================================
--- branches/yt-object-serialization/yt/extensions/lightcone/LightConeProjection.py	(original)
+++ branches/yt-object-serialization/yt/extensions/lightcone/LightConeProjection.py	Tue Jan  6 20:40:20 2009
@@ -36,7 +36,7 @@
 ####       the direction in question wherever DepthBoxFraction or WidthBoxFraction appears.
 ####       To be fixed before turning 30.  - Britton
 
-def LightConeProjection(lightConeSlice,field,pixels,weight_field=None,save_image=False,name="",field_cuts=None,**kwargs):
+def LightConeProjection(lightConeSlice,field,pixels,weight_field=None,save_image=False,name="",node=None,field_cuts=None,**kwargs):
     "Create a single projection to be added into the light cone stack."
 
     # Use some projection parameters to seed random number generator to make unique node name.
@@ -48,9 +48,10 @@
     # ProjectionCenter[ProjectionAxis]
     # DepthBoxFraction
 
-    node_name = "LightCone_%d_%f_%f" % (lightConeSlice['ProjectionAxis'],
-                                              lightConeSlice['ProjectionCenter'][lightConeSlice['ProjectionAxis']],
-                                              lightConeSlice['DepthBoxFraction'])
+    # Name node with user specified keyword if given with 'node' keyword.
+    node_name = "LightCone_%s_%d_%f_%f" % (node,lightConeSlice['ProjectionAxis'],
+                                           lightConeSlice['ProjectionCenter'][lightConeSlice['ProjectionAxis']],
+                                           lightConeSlice['DepthBoxFraction'])
 
     mylog.info("Making projection at z = %f from %s." % (lightConeSlice['redshift'],lightConeSlice['filename']))
 
@@ -79,11 +80,13 @@
             cut_mask = "(grid[\"%s\"] + 0.5*grid[\"d%s\"] >= %f) & (grid[\"%s\"] - 0.5*grid[\"%s\"] <= %f)" % (axis,axis,depthLeft,axis,axis,depthRight)
 
         if field_cuts is None:
-           field_cuts = []
-        field_cuts.append(cut_mask)
+            these_field_cuts = []
+        else:
+            these_field_cuts = copy.deepcopy(field_cuts)
+        these_field_cuts.append(cut_mask)
 
     # Make projection.
-    pc.add_projection(field,lightConeSlice['ProjectionAxis'],weight_field=weight_field,field_cuts=field_cuts,use_colorbar=True,
+    pc.add_projection(field,lightConeSlice['ProjectionAxis'],weight_field=weight_field,field_cuts=these_field_cuts,use_colorbar=True,
                       node_name=node_name,**kwargs)
 
     # 2. The Tile Problem

Modified: branches/yt-object-serialization/yt/extensions/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/extensions/setup.py	(original)
+++ branches/yt-object-serialization/yt/extensions/setup.py	Tue Jan  6 20:40:20 2009
@@ -5,5 +5,6 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('extensions',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     config.add_subpackage("lightcone")
     return config

Modified: branches/yt-object-serialization/yt/fido/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/fido/setup.py	(original)
+++ branches/yt-object-serialization/yt/fido/setup.py	Tue Jan  6 20:40:20 2009
@@ -5,4 +5,5 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('fido',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     return config

Modified: branches/yt-object-serialization/yt/funcs.py
==============================================================================

Modified: branches/yt-object-serialization/yt/lagos/BaseDataTypes.py
==============================================================================
--- branches/yt-object-serialization/yt/lagos/BaseDataTypes.py	(original)
+++ branches/yt-object-serialization/yt/lagos/BaseDataTypes.py	Tue Jan  6 20:40:20 2009
@@ -1588,19 +1588,19 @@
 
     def _is_fully_enclosed(self, grid):
         return na.all( (grid._corners < self.right_edge)
-                     & (grid._corners >= self.left_edge))
+                     & (grid._corners > self.left_edge))
 
     @cache_mask
     def _get_cut_mask(self, grid):
         if self._is_fully_enclosed(grid):
             return True
         else:
-            cm = ( (grid['x'] - grid['dx'] < self.right_edge[0])
-                 & (grid['x'] + grid['dx'] > self.left_edge[0])
-                 & (grid['y'] - grid['dy'] < self.right_edge[1])
-                 & (grid['y'] + grid['dy'] > self.left_edge[1])
-                 & (grid['z'] - grid['dz'] < self.right_edge[2])
-                 & (grid['z'] + grid['dz'] > self.left_edge[2]) )
+            cm = ( (grid['x'] - 0.5 * grid['dx'] < self.right_edge[0])
+                 & (grid['x'] + 0.5 * grid['dx'] > self.left_edge[0])
+                 & (grid['y'] - 0.5 * grid['dy'] < self.right_edge[1])
+                 & (grid['y'] + 0.5 * grid['dy'] > self.left_edge[1])
+                 & (grid['z'] - 0.5 * grid['dz'] < self.right_edge[2])
+                 & (grid['z'] + 0.5 * grid['dz'] > self.left_edge[2]) )
         return cm
 
 class AMRPeriodicRegionBase(AMR3DData):

Modified: branches/yt-object-serialization/yt/lagos/DerivedQuantities.py
==============================================================================

Modified: branches/yt-object-serialization/yt/lagos/HierarchyType.py
==============================================================================

Modified: branches/yt-object-serialization/yt/lagos/ParallelTools.py
==============================================================================

Modified: branches/yt-object-serialization/yt/lagos/PointCombine.c
==============================================================================
--- branches/yt-object-serialization/yt/lagos/PointCombine.c	(original)
+++ branches/yt-object-serialization/yt/lagos/PointCombine.c	Tue Jan  6 20:40:20 2009
@@ -882,7 +882,7 @@
     
     con_ids   = (PyArrayObject *) PyArray_FromAny(ocon_ids,
                     PyArray_DescrFromType(NPY_INT64), 3, 3,
-                    NPY_INOUT_ARRAY | NPY_UPDATEIFCOPY, NULL);
+                    0 | NPY_UPDATEIFCOPY, NULL);
     if((con_ids==NULL) || (con_ids->nd != 3)) {
     PyErr_Format(_findContoursError,
              "FindContours: Three dimensions required for con_ids.");
@@ -891,7 +891,7 @@
 
     xi = (PyArrayObject *) PyArray_FromAny(oxi,
                     PyArray_DescrFromType(NPY_INT64), 1, 1,
-                    NPY_IN_ARRAY, NULL);
+                    0, NULL);
     if(xi==NULL) {
     PyErr_Format(_findContoursError,
              "Bin2DProfile: One dimension required for xi.");
@@ -900,7 +900,7 @@
     
     yi = (PyArrayObject *) PyArray_FromAny(oyi,
                     PyArray_DescrFromType(NPY_INT64), 1, 1,
-                    NPY_IN_ARRAY, NULL);
+                    0, NULL);
     if((yi==NULL) || (PyArray_SIZE(xi) != PyArray_SIZE(yi))) {
     PyErr_Format(_findContoursError,
              "Bin2DProfile: One dimension required for yi, same size as xi.");
@@ -909,7 +909,7 @@
     
     zi = (PyArrayObject *) PyArray_FromAny(ozi,
                     PyArray_DescrFromType(NPY_INT64), 1, 1,
-                    NPY_IN_ARRAY, NULL);
+                    0, NULL);
     if((zi==NULL) || (PyArray_SIZE(xi) != PyArray_SIZE(zi))) {
     PyErr_Format(_findContoursError,
              "Bin2DProfile: One dimension required for zi, same size as xi.");

Modified: branches/yt-object-serialization/yt/lagos/Profiles.py
==============================================================================

Modified: branches/yt-object-serialization/yt/lagos/hop/HopOutput.py
==============================================================================
--- branches/yt-object-serialization/yt/lagos/hop/HopOutput.py	(original)
+++ branches/yt-object-serialization/yt/lagos/hop/HopOutput.py	Tue Jan  6 20:40:20 2009
@@ -111,22 +111,25 @@
         Write out standard HOP information to *filename*.
         """
         f = open(filename,"w")
-        f.write("\t".join(["# Group","Mass","# part","max dens"
-                           "x","y","z", "center-of-mass",
-                           "x","y","z",
-                           "vx","vy","vz","max_r","\n"]))
+        f.write("#% 9s\t% 16s\t% 10s\t" % ("Group","Mass", "npart"))
+        f.write("\t".join(["% 16s" % i for i in 
+                            "max dens",
+                            "max_rho_x","max_rho_y","max_rho_z",
+                            "com_x","com_y","com_z",
+                            "vx","vy","vz","max_r"]))
+        f.write("\n")
         for group in self:
-            f.write("%10i\t" % group.id)
-            f.write("%0.9e\t" % group.total_mass())
-            f.write("%10i\t" % group.indices.size)
-            f.write("%0.9e\t" % group.maximum_density())
-            f.write("\t".join(["%0.9e" % v for v in group.maximum_density_location()]))
+            f.write("% 10i\t" % group.id)
+            f.write("% 0.9e\t" % group.total_mass())
+            f.write("% 10i\t" % group.indices.size)
+            f.write("% 0.9e\t" % group.maximum_density())
+            f.write("\t".join(["% 0.9e" % v for v in group.maximum_density_location()]))
             f.write("\t")
-            f.write("\t".join(["%0.9e" % v for v in group.center_of_mass()]))
+            f.write("\t".join(["% 0.9e" % v for v in group.center_of_mass()]))
             f.write("\t")
-            f.write("\t".join(["%0.9e" % v for v in group.bulk_velocity()]))
+            f.write("\t".join(["% 0.9e" % v for v in group.bulk_velocity()]))
             f.write("\t")
-            f.write("%0.9e\t" % group.maximum_radius())
+            f.write("% 0.9e\t" % group.maximum_radius())
             f.write("\n")
         f.close()
 
@@ -226,6 +229,9 @@
                         center, radius=radius)
         return sphere
 
+    def get_size(self):
+        return self.indices.size
+
 class HaloFinder(ParallelAnalysisInterface):
     def __init__(self, pf, threshold=160.0, dm_only=True):
         self.pf = pf

Modified: branches/yt-object-serialization/yt/lagos/hop/SS_HopOutput.py
==============================================================================
--- branches/yt-object-serialization/yt/lagos/hop/SS_HopOutput.py	(original)
+++ branches/yt-object-serialization/yt/lagos/hop/SS_HopOutput.py	Tue Jan  6 20:40:20 2009
@@ -245,7 +245,7 @@
         return self.indices.size
 
 class HaloFinder(HopList, ParallelAnalysisInterface):
-    def __init__(self, pf, threshold=160.0, dm_only=True):
+    def __init__(self, pf, threshold=160.0, dm_only=True, padding=0.2):
         self.pf = pf
         self.hierarchy = pf.h
         self.center = (pf["DomainRightEdge"] + pf["DomainLeftEdge"])/2.0
@@ -258,7 +258,7 @@
         # are all on different processors, we should instead construct an
         # object representing the entire domain and sum it "lazily" with
         # Derived Quantities.
-        self.padding = 0.2 #* pf["unitary"] # This should be clevererer
+        self.padding = padding #* pf["unitary"] # This should be clevererer
         padded, LE, RE, self.data_source = self._partition_hierarchy_3d(padding=self.padding)
         self.bounds = (LE, RE)
         # reflect particles around the periodic boundary
@@ -268,7 +268,8 @@
                                   ["particle_position_%s" % ax for ax in 'xyz'])
         # MJT: This is the point where HOP is run, and we have halos for every
         # single sub-region
-        super(HaloFinder, self).__init__(self.data_source, threshold, dm_only)
+        sub_mass = self.data_source["ParticleMassMsun"].sum()
+        super(HaloFinder, self).__init__(self.data_source, threshold*total_mass/sub_mass, dm_only)
         self._parse_hoplist()
         self._join_hoplists()
 

Modified: branches/yt-object-serialization/yt/lagos/hop/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/lagos/hop/setup.py	(original)
+++ branches/yt-object-serialization/yt/lagos/hop/setup.py	Tue Jan  6 20:40:20 2009
@@ -8,6 +8,7 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('hop',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     config.add_extension("EnzoHop", sources=
                                     ["EnzoHop.c",
                                      "hop_hop.c",

Modified: branches/yt-object-serialization/yt/lagos/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/lagos/setup.py	(original)
+++ branches/yt-object-serialization/yt/lagos/setup.py	Tue Jan  6 20:40:20 2009
@@ -18,6 +18,7 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('lagos',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     config.add_extension("PointCombine", "yt/lagos/PointCombine.c", libraries=["m"])
     #config.add_extension("RTIntegrator", "yt/lagos/RTIntegrator.c")
     config.add_extension("Interpolators", "yt/lagos/Interpolators.c")

Modified: branches/yt-object-serialization/yt/mods.py
==============================================================================

Modified: branches/yt-object-serialization/yt/raven/Callbacks.py
==============================================================================
--- branches/yt-object-serialization/yt/raven/Callbacks.py	(original)
+++ branches/yt-object-serialization/yt/raven/Callbacks.py	Tue Jan  6 20:40:20 2009
@@ -37,7 +37,7 @@
 class PlotCallback(object):
     class __metaclass__(type):
         def __init__(cls, name, b, d):
-            type.__init__(name, b, d)
+            type.__init__(cls, name, b, d)
             callback_registry.append((name, cls))
 
     def __init__(self, *args, **kwargs):
@@ -397,13 +397,11 @@
         plot._axes.hold(False)
 
 class ClumpContourCallback(PlotCallback):
-    def __init__(self, clumps, axis, plot_args = None):
+    def __init__(self, clumps, axis = None, plot_args = None):
         """
         Take a list of *clumps* and plot them as a set of contours.
         """
         self.clumps = clumps
-        self.xf = lagos.axis_names[lagos.x_dict[axis]]
-        self.yf = lagos.axis_names[lagos.y_dict[axis]]
         if plot_args is None: plot_args = {}
         self.plot_args = plot_args
 
@@ -413,13 +411,14 @@
         xx0, xx1 = plot._axes.get_xlim()
         yy0, yy1 = plot._axes.get_ylim()
         plot._axes.hold(True)
-        
+        xf = lagos.axis_names[lagos.x_dict[plot.data.axis]]
+        yf = lagos.axis_names[lagos.y_dict[plot.data.axis]]
+
         nx, ny = plot.image._A.shape
         buff = na.zeros((nx,ny),dtype='float64')
         for i,clump in enumerate(reversed(self.clumps)):
             mylog.debug("Pixelizing contour %s", i)
-            temp = _MPL.Pixelize(clump[self.xf],
-                                 clump[self.yf],
+            temp = _MPL.Pixelize(clump[xf], clump[yf],
                                  clump['dx']/2.0,
                                  clump['dy']/2.0,
                                  clump['dx']*0.0+i+1, # inits inside Pixelize
@@ -476,7 +475,8 @@
         radius = self.radius * dx
         center_x = (self.center[xi] - x0)*dx
         center_y = (self.center[yi] - y0)*dy
-        cir = Circle((center_x, center_y), radius, fill=False,
+        # origin = lower?  not sure why center_y and center_x are reversed
+        cir = Circle((center_y, center_x), radius, fill=False,
                      **self.circle_args)
         plot._axes.add_patch(cir)
         if self.text is not None:

Modified: branches/yt-object-serialization/yt/raven/ColorMaps.py
==============================================================================
--- branches/yt-object-serialization/yt/raven/ColorMaps.py	(original)
+++ branches/yt-object-serialization/yt/raven/ColorMaps.py	Tue Jan  6 20:40:20 2009
@@ -85,3 +85,14 @@
          'green':zip(_vs,_kamae_grn,_kamae_grn),
          'blue':zip(_vs,_kamae_blu,_kamae_blu)}
 add_cmap('kamae', cdict)
+
+# This one is a simple black & green map
+
+cdict = {'red':   ((0.0, 0.0, 0.0),
+                   (1.0, 0.0, 0.0)),
+         'green': ((0.0, 0.0, 0.0),
+                   (1.0, 1.0, 1.0)),
+         'blue':  ((0.0, 0.0, 0.0),
+                   (1.0, 0.0, 0.0))}
+
+add_cmap('black_green', cdict)

Modified: branches/yt-object-serialization/yt/raven/deliveration/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/raven/deliveration/setup.py	(original)
+++ branches/yt-object-serialization/yt/raven/deliveration/setup.py	Tue Jan  6 20:40:20 2009
@@ -5,4 +5,5 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('deliveration',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     return config

Modified: branches/yt-object-serialization/yt/raven/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/raven/setup.py	(original)
+++ branches/yt-object-serialization/yt/raven/setup.py	Tue Jan  6 20:40:20 2009
@@ -7,5 +7,6 @@
     config.add_subpackage("deliveration")
     config.add_subpackage("delaunay") # From SciPy, primarily written by Robert Kern
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     config.add_extension("_MPL", "_MPL.c", libraries=["m"])
     return config

Modified: branches/yt-object-serialization/yt/reason/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/reason/setup.py	(original)
+++ branches/yt-object-serialization/yt/reason/setup.py	Tue Jan  6 20:40:20 2009
@@ -6,4 +6,5 @@
     from numpy.distutils.misc_util import Configuration
     config = Configuration('reason',parent_package,top_path)
     config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
     return config

Modified: branches/yt-object-serialization/yt/setup.py
==============================================================================
--- branches/yt-object-serialization/yt/setup.py	(original)
+++ branches/yt-object-serialization/yt/setup.py	Tue Jan  6 20:40:20 2009
@@ -11,6 +11,7 @@
     config.add_subpackage('reason')
     config.add_subpackage('extensions')
     config.make_config_py()
+    config.make_svn_version_py()
     return config
 
 if __name__ == '__main__':



More information about the yt-svn mailing list