[Yt-svn] commit/yt: 3 new changesets

Bitbucket commits-noreply at bitbucket.org
Mon May 9 15:14:41 PDT 2011


3 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/212122de07ba/
changeset:   r4242:212122de07ba
branch:      yt
user:        jsoishi
date:        2011-05-09 22:55:44
summary:     added units and magnitude of magnetic field for Enzo
affected #:  1 file (467 bytes)

--- a/yt/frontends/enzo/fields.py	Fri Apr 22 19:04:31 2011 -0400
+++ b/yt/frontends/enzo/fields.py	Mon May 09 13:55:44 2011 -0700
@@ -482,3 +482,18 @@
                     dtype='float64')
 add_enzo_1d_field("z-velocity", function=_zvel)
 add_enzo_1d_field("y-velocity", function=_yvel)
+
+def _convertBfield(data): 
+    return na.sqrt(4*na.pi*data.convert("Density")*data.convert("x-velocity")**2)
+for field in ['Bx','By','Bz']:
+    f = EnzoFieldInfo[field]
+    f._convert_function=_convertBfield
+    f._units=r"\mathrm{Gau\ss}"
+    f.take_log=False
+
+def _Bmag(field, data):
+    """ magnitude of bvec
+    """
+    return na.sqrt(data['Bx']**2 + data['By']**2 + data['Bz']**2)
+
+add_field("Bmag", function=_Bmag,display_name=r"|B|",units=r"\mathrm{Gau\ss}")


http://bitbucket.org/yt_analysis/yt/changeset/1512c81da702/
changeset:   r4243:1512c81da702
branch:      yt
user:        jsoishi
date:        2011-05-10 00:13:46
summary:     added proton charge in emu.
affected #:  1 file (91 bytes)

--- a/yt/utilities/physical_constants.py	Mon May 09 13:55:44 2011 -0700
+++ b/yt/utilities/physical_constants.py	Mon May 09 15:13:46 2011 -0700
@@ -11,6 +11,9 @@
 # Cross Sections
 cross_section_thompson_cgs = 6.65e-25 # cm^2
 
+# Charge
+charge_proton_cgs = 4.803e-28 # emu = 1.602e-19  Coulombs
+
 # Physical Constants
 boltzmann_constant_cgs = 1.3806504e-16 # erg K^-1
 gravitational_constant_cgs  = 6.67428e-8 # cm^3 g^-1 s^-2
@@ -47,6 +50,7 @@
 G = gravitational_constant_cgs
 me = mass_electron_cgs
 mp = mass_hydrogen_cgs
+qp = charge_proton_cgs
 mh = mp
 clight = speed_of_light_cgs
 kboltz = boltzmann_constant_cgs


http://bitbucket.org/yt_analysis/yt/changeset/4b0fb867db6b/
changeset:   r4244:4b0fb867db6b
branch:      yt
user:        jsoishi
date:        2011-05-10 00:14:08
summary:     merged.
affected #:  217 files (97.9 KB)

--- a/yt/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -64,7 +64,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -94,8 +94,8 @@
     recursive_bottom_clumps, \
     clump_list_sort
 
-from .light_ray.api import \
-    LightRay
+#from .light_ray.api import \
+#    LightRay
 
 from .light_cone.api import \
     LightCone, \


--- a/yt/analysis_modules/coordinate_transformation/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/coordinate_transformation/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/coordinate_transformation/transforms.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/coordinate_transformation/transforms.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Organization: UC Berkeley
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk, J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk, J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_finding/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_finding/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_finding/fof/EnzoFOF.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_finding/fof/EnzoFOF.c	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/analysis_modules/halo_finding/halo_objects.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_finding/halo_objects.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_finding/hop/EnzoHop.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_finding/hop/EnzoHop.c	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD/CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Stephen Skory.  All Rights Reserved.
+  Copyright (C) 2008-2011 Stephen Skory.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_mass_function/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_mass_function/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_mass_function/halo_mass_function.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_mass_function/halo_mass_function.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC San Diego / CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Stephen Skory (and others).  All Rights Reserved.
+  Copyright (C) 2008-2011 Stephen Skory (and others).  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_merger_tree/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_merger_tree/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_merger_tree/enzofof_merger_tree.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_merger_tree/enzofof_merger_tree.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 catalogs output by Enzo and then compare parent/child relationships.
 
 Author: Matthew J. Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Author: John H. Wise <jwise at astro.princeton.edu>
 Affiliation: Princeton
 Homepage: http://yt.enzotools.org/


--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASS/UC San Diego, CA
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 Stephen Skory.  All Rights Reserved.
+  Copyright (C) 2008-2011 Stephen Skory.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_profiler/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_profiler/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_profiler/halo_filters.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_profiler/halo_filters.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/hierarchy_subset/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/hierarchy_subset/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/hierarchy_subset/hierarchy_subset.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/hierarchy_subset/hierarchy_subset.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/level_sets/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/level_sets/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/level_sets/clump_handling.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/level_sets/clump_handling.py	Mon May 09 15:14:08 2011 -0700
@@ -4,7 +4,7 @@
 Author: Britton Smith <Britton.Smith at colorado.edu>
 Affiliation: University of Colorado at Boulder
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -25,6 +25,8 @@
 import numpy as na
 import copy
 
+from yt.funcs import *
+
 from .contour_finder import identify_contours
 
 class Clump(object):
@@ -153,7 +155,11 @@
 def _reconstruct_clump(parent, field, mi, ma, function_value, children, data, clump_info, 
         function=None):
     obj = object.__new__(Clump)
-    if iterable(parent): parent = parent[1]
+    if iterable(parent):
+        try:
+            parent = parent[1]
+        except KeyError:
+            parent = parent
     if children is None: children = []
     obj.parent, obj.field, obj.min_val, obj.max_val, obj.function_value, obj.children, obj.clump_info, obj.function = \
         parent, field, mi, ma, function_value, children, clump_info, function


--- a/yt/analysis_modules/level_sets/contour_finder.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/level_sets/contour_finder.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/common_n_volume.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/common_n_volume.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/halo_mask.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/halo_mask.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/light_cone.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/light_cone.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/light_cone_projection.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/light_cone_projection.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_cone/unique_solution.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_cone/unique_solution.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_ray/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_ray/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/light_ray/light_ray.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/light_ray/light_ray.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -138,7 +138,7 @@
 
     def make_light_ray(self, seed=None, fields=None, 
                        solution_filename=None, data_filename=None,
-                       get_nearest_galaxy=False, **kwargs):
+                       get_nearest_galaxy=False, get_los_velocity=False, **kwargs):
         "Create a light ray and get field values for each lixel."
 
         # Calculate solution.
@@ -153,6 +153,9 @@
         if get_nearest_galaxy:
             all_fields.extend(['x', 'y', 'z', 'nearest_galaxy', 'nearest_galaxy_mass'])
             fields.extend(['x', 'y', 'z'])
+        if get_los_velocity:
+            all_fields.extend(['x-velocity', 'y-velocity', 'z-velocity', 'los_velocity'])
+            fields.extend(['x-velocity', 'y-velocity', 'z-velocity'])
 
         todo = na.arange(my_rank, len(self.light_ray_solution), my_size)
         for index in todo:
@@ -195,6 +198,17 @@
                     sub_data[field] = na.concatenate([sub_data[field], 
                                                       (sub_ray[field])])
 
+                if get_los_velocity:
+                    line_of_sight = sub_segment[1] - sub_segment[0]
+                    line_of_sight /= ((line_of_sight**2).sum())**0.5
+                    sub_vel = na.array([sub_ray['x-velocity'], 
+                                        sub_ray['y-velocity'],
+                                        sub_ray['z-velocity']])
+                    sub_data['los_velocity'] = na.concatenate([sub_data['los_velocity'], 
+                                                               (na.rollaxis(sub_vel, 1) * 
+                                                                line_of_sight).sum(axis=1)])
+                    del sub_vel
+
                 sub_ray.clear_data()
                 del sub_ray
 


--- a/yt/analysis_modules/list_modules.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/list_modules.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/simulation_handler/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/simulation_handler/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/simulation_handler/enzo_simulation.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/simulation_handler/enzo_simulation.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/spectral_integrator/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/spectral_integrator/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/star_analysis/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/star_analysis/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/star_analysis/sfr_spectrum.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/star_analysis/sfr_spectrum.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC San Diego / CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Stephen Skory (and others).  All Rights Reserved.
+  Copyright (C) 2008-2011 Stephen Skory (and others).  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/sunrise_export/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/sunrise_export/api.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/sunrise_export/sunrise_exporter.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/sunrise_export/sunrise_exporter.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/two_point_functions/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/two_point_functions/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/analysis_modules/two_point_functions/two_point_functions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/analysis_modules/two_point_functions/two_point_functions.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Stephen Skory.  All Rights Reserved.
+  Copyright (C) 2010-2011 Stephen Skory.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/arraytypes.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/arraytypes.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/astro_objects/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/astro_objects/api.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 API for yt.astro_objects
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/astro_objects/astrophysical_object.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/astro_objects/astrophysical_object.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 A base-class representing an astrophysical object
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/astro_objects/clumped_region.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/astro_objects/clumped_region.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 A base-class representing an astrophysical object
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/astro_objects/simulation_volume.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/astro_objects/simulation_volume.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 An AstrophysicalObject that represents a simulation volume
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/config.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/config.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/convenience.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/convenience.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/analyzer_objects.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/analyzer_objects.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/data_containers.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/data_containers.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: University of Colorado at Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -626,7 +626,10 @@
                               grid.child_mask)
         if field == 'dts': return self._dts[grid.id][mask]
         if field == 't': return self._ts[grid.id][mask]
-        return grid[field][mask]
+        gf = grid[field]
+        if not iterable(gf):
+            gf = gf * na.ones(grid.child_mask.shape)
+        return gf[mask]
         
     @cache_mask
     def _get_cut_mask(self, grid):
@@ -2906,7 +2909,7 @@
         """
         AMR3DData.__init__(self, center, fields, pf, **kwargs)
         # Unpack the radius, if necessary
-        if isinstance(radius, tuple) and len(radius) == 2 and \
+        if isinstance(radius, (list, tuple)) and len(radius) == 2 and \
            isinstance(radius[1], types.StringTypes):
            radius = radius[0]/self.pf[radius[1]]
         if radius < self.hierarchy.get_smallest_dx():


--- a/yt/data_objects/derived_quantities.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/derived_quantities.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/field_info_container.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/field_info_container.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -177,15 +177,16 @@
                 lambda: na.ones((nd*nd*nd), dtype='float64')
                 + 1e-4*na.random.random((nd*nd*nd)))
     def __missing__(self, item):
-        if FieldInfo.has_key(item) and \
-            FieldInfo[item]._function.func_name != '<lambda>':
+        FI = getattr(self.pf, "field_info", FieldInfo)
+        if FI.has_key(item) and \
+            FI[item]._function.func_name != '<lambda>':
             try:
-                vv = FieldInfo[item](self)
+                vv = FI[item](self)
             except NeedsGridType as exc:
                 ngz = exc.ghost_zones
                 nfd = FieldDetector(self.nd+ngz*2)
                 nfd._num_ghost_zones = ngz
-                vv = FieldInfo[item](nfd)
+                vv = FI[item](nfd)
                 if ngz > 0: vv = vv[ngz:-ngz,ngz:-ngz,ngz:-ngz]
                 for i in nfd.requested:
                     if i not in self.requested: self.requested.append(i)
@@ -200,8 +201,9 @@
 
     def _read_data(self, field_name):
         self.requested.append(field_name)
-        if FieldInfo.has_key(field_name) and \
-           FieldInfo[field_name].particle_type:
+        FI = getattr(self.pf, "field_info", FieldInfo)
+        if FI.has_key(field_name) and \
+           FI[field_name].particle_type:
             self.requested.append(field_name)
             return na.ones(self.NumberOfParticles)
         return defaultdict.__missing__(self, field_name)


--- a/yt/data_objects/grid_patch.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/grid_patch.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/hierarchy.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/hierarchy.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/object_finding_mixin.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/object_finding_mixin.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/profiles.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/profiles.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: CASA, University of Colorado at Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/static_output.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/static_output.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk, J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk, J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/time_series.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/time_series.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/data_objects/universal_fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/data_objects/universal_fields.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/art/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/art/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/art/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/art/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/art/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/art/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -124,9 +124,9 @@
 
     def _detect_fields(self):
         # This will need to be generalized to be used elsewhere.
-        self.field_list = [ 'Density','Total_Energy',
+        self.field_list = [ 'Density','TotalEnergy',
                             'x-momentum','y-momentum','z-momentum',
-                            'Pressure','Gamma','Gas_Energy',
+                            'Pressure','Gamma','GasEnergy',
                             'Metal_DensitySNII', 'Metal_DensitySNIa',
                             'Potential_New','Potential_Old']
     
@@ -434,7 +434,7 @@
         self.tr = 2./3. *(3.03e5*self.r0**2.0*wmu*self.omega_matter)*(1.0/(aexpn**2))      
         self.conversion_factors["Density"] = \
             self.rho0*(aexpn**-3.0)
-        self.conversion_factors["Gas_Energy"] = \
+        self.conversion_factors["GasEnergy"] = \
             self.rho0*self.v0**2*(aexpn**-5.0)
         tr  = self.tr
         self.conversion_factors["Temperature"] = tr


--- a/yt/frontends/art/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/art/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -45,13 +45,13 @@
 add_field = add_art_field
 
 translation_dict = {"Density":"density",
-                    "Total_Energy":"Total_Energy",
+                    "TotalEnergy":"TotalEnergy",
                     "x-velocity":"velocity_x",
                     "y-velocity":"velocity_y",
                     "z-velocity":"velocity_z",
                     "Pressure":"pressure",
                     "Metallicity":"metallicity",
-                    "Gas_Energy":"Gas_Energy"
+                    "GasEnergy":"GasEnergy"
                    }
 
 def _generate_translation(mine, theirs):
@@ -78,13 +78,13 @@
 ARTFieldInfo["Density"]._convert_function=_convertDensity
 
 def _convertEnergy(data):
-    return data.convert("Gas_Energy")
-ARTFieldInfo["Gas_Energy"]._units = r"\rm{ergs}/\rm{g}"
-ARTFieldInfo["Gas_Energy"]._convert_function=_convertEnergy
+    return data.convert("GasEnergy")
+ARTFieldInfo["GasEnergy"]._units = r"\rm{ergs}/\rm{g}"
+ARTFieldInfo["GasEnergy"]._convert_function=_convertEnergy
 
 def _Temperature(field, data):
-    tr  = data["Gas_Energy"] / data["Density"]
-    tr /= data.pf.conversion_factors["Gas_Energy"]
+    tr  = data["GasEnergy"] / data["Density"]
+    tr /= data.pf.conversion_factors["GasEnergy"]
     tr *= data.pf.conversion_factors["Density"]
     return tr
 def _convertTemperature(data):


--- a/yt/frontends/art/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/art/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,29 @@
+"""
+API for yt.frontends.castro
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: UCSD
+Author: J.S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: MSU
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/api.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,42 @@
+"""
+API for yt.frontends.castro
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: UCSD
+Author: J.S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: MSU
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""
+
+from .data_structures import \
+      CastroGrid, \
+      CastroHierarchy, \
+      CastroStaticOutput
+
+from .fields import \
+      CastroFieldContainer, \
+      CastroFieldInfo, \
+      add_castro_field
+
+from .io import \
+      IOHandlerNative


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,683 @@
+"""
+Data structures for Castro. 
+
+Author: J. S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2008-2010 J. S. Oishi.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+import re
+import os
+import weakref
+import itertools
+import numpy as na
+
+from collections import \
+    defaultdict
+from string import \
+    strip, \
+    rstrip
+from stat import \
+    ST_CTIME
+
+from yt.funcs import *
+from yt.data_objects.grid_patch import \
+           AMRGridPatch
+from yt.data_objects.hierarchy import \
+           AMRHierarchy
+from yt.data_objects.static_output import \
+           StaticOutput
+from yt.utilities.definitions import \
+    mpc_conversion
+
+from .definitions import \
+    castro2enzoDict, \
+    parameterDict, \
+    yt2castroFieldsDict, \
+    castro_FAB_header_pattern, \
+    castro_particle_field_names
+
+from .fields import \
+    CastroFieldContainer, \
+    add_field
+
+
+class CastroGrid(AMRGridPatch):
+    _id_offset = 0
+    def __init__(self, LeftEdge, RightEdge, index, level, filename, offset, dimensions, start, stop, paranoia=False,**kwargs):
+        AMRGridPatch.__init__(self, index,**kwargs)
+        self.filename = filename
+        self._offset = offset
+        self._paranoid = paranoia
+        
+        # should error check this
+        self.ActiveDimensions = (dimensions.copy()).astype('int32')#.transpose()
+        self.start_index = start.copy()#.transpose()
+        self.stop_index = stop.copy()#.transpose()
+        self.LeftEdge  = LeftEdge.copy()
+        self.RightEdge = RightEdge.copy()
+        self.index = index
+        self.Level = level
+
+    def get_global_startindex(self):
+        return self.start_index
+
+    def _prepare_grid(self):
+        """
+        Copies all the appropriate attributes from the hierarchy
+        """
+        # This is definitely the slowest part of generating the hierarchy
+        # Now we give it pointers to all of its attributes
+        # Note that to keep in line with Enzo, we have broken PEP-8
+        h = self.hierarchy # cache it
+        #self.StartIndices = h.gridStartIndices[self.id]
+        #self.EndIndices = h.gridEndIndices[self.id]
+        h.grid_levels[self.id,0] = self.Level
+        h.grid_left_edge[self.id,:] = self.LeftEdge[:]
+        h.grid_right_edge[self.id,:] = self.RightEdge[:]
+        #self.Time = h.gridTimes[self.id,0]
+        #self.NumberOfParticles = h.gridNumberOfParticles[self.id,0]
+        self.field_indexes = h.field_indexes
+        self.Children = h.gridTree[self.id]
+        pIDs = h.gridReverseTree[self.id]
+        if len(pIDs) > 0:
+            self.Parent = [weakref.proxy(h.grids[pID]) for pID in pIDs]
+        else:
+            self.Parent = None
+
+    def _setup_dx(self):
+        # So first we figure out what the index is.  We don't assume
+        # that dx=dy=dz , at least here.  We probably do elsewhere.
+        id = self.id - self._id_offset
+        if self.Parent is not None:
+            self.dds = self.Parent[0].dds / self.pf.refine_by
+        else:
+            LE, RE = self.hierarchy.grid_left_edge[id,:], \
+                     self.hierarchy.grid_right_edge[id,:]
+            self.dds = na.array((RE-LE)/self.ActiveDimensions)
+        if self.pf.dimensionality < 2: self.dds[1] = 1.0
+        if self.pf.dimensionality < 3: self.dds[2] = 1.0
+        self.data['dx'], self.data['dy'], self.data['dz'] = self.dds
+
+    def __repr__(self):
+        return "CastroGrid_%04i" % (self.id)
+
+class CastroHierarchy(AMRHierarchy):
+    grid = CastroGrid
+    def __init__(self, pf, data_style='castro_native'):
+        self.field_info = CastroFieldContainer()
+        self.field_indexes = {}
+        self.parameter_file = weakref.proxy(pf)
+        header_filename = os.path.join(pf.fullplotdir, 'Header')
+        self.directory = pf.fullpath
+        self.data_style = data_style
+        #self._setup_classes()
+
+        # This also sets up the grid objects
+        self.read_global_header(header_filename, self.parameter_file.paranoid_read) 
+        self.read_particle_header()
+        self.__cache_endianness(self.levels[-1].grids[-1])
+        AMRHierarchy.__init__(self, pf, self.data_style)
+        self._setup_data_io()
+        self._setup_field_list()
+        self._populate_hierarchy()
+        
+    def read_global_header(self, filename, paranoid_read):
+        """
+        read the global header file for an Castro plotfile output.
+        """
+        counter = 0
+        header_file = open(filename,'r')
+        self.__global_header_lines = header_file.readlines()
+
+        # parse the file
+        self.castro_version = self.__global_header_lines[0].rstrip()
+        self.n_fields      = int(self.__global_header_lines[1])
+
+        counter = self.n_fields+2
+        self.field_list = []
+        for i, line in enumerate(self.__global_header_lines[2:counter]):
+            self.field_list.append(line.rstrip())
+
+        # this is unused...eliminate it?
+        #for f in self.field_indexes:
+        #    self.field_list.append(castro2ytFieldsDict.get(f, f))
+
+        self.dimension = int(self.__global_header_lines[counter])
+        if self.dimension != 3:
+            raise RunTimeError("Castro must be in 3D to use yt.")
+        counter += 1
+        self.Time = float(self.__global_header_lines[counter])
+        counter += 1
+        self.finest_grid_level = int(self.__global_header_lines[counter])
+        self.n_levels = self.finest_grid_level + 1
+        counter += 1
+        # quantities with _unnecessary are also stored in the inputs
+        # file and are not needed.  they are read in and stored in
+        # case in the future we want to enable a "backwards" way of
+        # taking the data out of the Header file and using it to fill
+        # in in the case of a missing inputs file
+        self.domainLeftEdge_unnecessary = na.array(map(float, self.__global_header_lines[counter].split()))
+        counter += 1
+        self.domainRightEdge_unnecessary = na.array(map(float, self.__global_header_lines[counter].split()))
+        counter += 1
+        self.refinementFactor_unnecessary = self.__global_header_lines[counter].split() #na.array(map(int, self.__global_header_lines[counter].split()))
+        counter += 1
+        self.globalIndexSpace_unnecessary = self.__global_header_lines[counter]
+        #domain_re.search(self.__global_header_lines[counter]).groups()
+        counter += 1
+        self.timestepsPerLevel_unnecessary = self.__global_header_lines[counter]
+        counter += 1
+        self.dx = na.zeros((self.n_levels,3))
+        for i, line in enumerate(self.__global_header_lines[counter:counter+self.n_levels]):
+            self.dx[i] = na.array(map(float, line.split()))
+        counter += self.n_levels
+        self.geometry = int(self.__global_header_lines[counter])
+        if self.geometry != 0:
+            raise RunTimeError("yt only supports cartesian coordinates.")
+        counter += 1
+
+        # this is just to debug. eventually it should go away.
+        linebreak = int(self.__global_header_lines[counter])
+        if linebreak != 0:
+            raise RunTimeError("INTERNAL ERROR! This should be a zero.")
+        counter += 1
+
+        # each level is one group with ngrids on it. each grid has 3 lines of 2 reals
+        self.levels = []
+        grid_counter = 0
+        file_finder_pattern = r"FabOnDisk: (\w+_D_[0-9]{4}) (\d+)\n"
+        re_file_finder = re.compile(file_finder_pattern)
+        dim_finder_pattern = r"\(\((\d+,\d+,\d+)\) \((\d+,\d+,\d+)\) \(\d+,\d+,\d+\)\)\n"
+        re_dim_finder = re.compile(dim_finder_pattern)
+        data_files_pattern = r"Level_[\d]/"
+        data_files_finder = re.compile(data_files_pattern)
+
+        for level in range(0, self.n_levels):
+            tmp = self.__global_header_lines[counter].split()
+            # should this be grid_time or level_time??
+            lev, ngrids, grid_time = int(tmp[0]), int(tmp[1]), float(tmp[2])
+            counter += 1
+            nsteps = int(self.__global_header_lines[counter])
+            counter += 1
+            self.levels.append(CastroLevel(lev, ngrids))
+            # open level header, extract file names and offsets for
+            # each grid
+            # read slightly out of order here: at the end of the lo, hi
+            # pairs for x, y, z is a *list* of files types in the Level
+            # directory. each type has Header and a number of data
+            # files (one per processor)
+            tmp_offset = counter + 3*ngrids
+            nfiles = 0
+            key_off = 0
+            files =   {} # dict(map(lambda a: (a,[]), self.field_list))
+            offsets = {} # dict(map(lambda a: (a,[]), self.field_list))
+            while nfiles+tmp_offset < len(self.__global_header_lines) and data_files_finder.match(self.__global_header_lines[nfiles+tmp_offset]):
+                filen = os.path.join(self.parameter_file.fullplotdir, \
+                                     self.__global_header_lines[nfiles+tmp_offset].strip())
+                # open each "_H" header file, and get the number of
+                # components within it
+                level_header_file = open(filen+'_H','r').read()
+                start_stop_index = re_dim_finder.findall(level_header_file) # just take the last one
+                grid_file_offset = re_file_finder.findall(level_header_file)
+                ncomp_this_file = int(level_header_file.split('\n')[2])
+                for i in range(ncomp_this_file):
+                    key = self.field_list[i+key_off]
+                    f, o = zip(*grid_file_offset)
+                    files[key] = f
+                    offsets[key] = o
+                    self.field_indexes[key] = i
+                key_off += ncomp_this_file
+                nfiles += 1
+            # convert dict of lists to list of dicts
+            fn = []
+            off = []
+            lead_path = os.path.join(self.parameter_file.fullplotdir,'Level_%i'%level)
+            for i in range(ngrids):
+                fi = [os.path.join(lead_path, files[key][i]) for key in self.field_list]
+                of = [int(offsets[key][i]) for key in self.field_list]
+                fn.append(dict(zip(self.field_list, fi)))
+                off.append(dict(zip(self.field_list, of)))
+
+            for grid in range(0, ngrids):
+                gfn = fn[grid]  # filename of file containing this grid
+                gfo = off[grid] # offset within that file
+                xlo, xhi = map(float, self.__global_header_lines[counter].split())
+                counter+=1
+                ylo, yhi = map(float, self.__global_header_lines[counter].split())
+                counter+=1
+                zlo, zhi = map(float, self.__global_header_lines[counter].split())
+                counter+=1
+                lo = na.array([xlo, ylo, zlo])
+                hi = na.array([xhi, yhi, zhi])
+                dims, start, stop = self.__calculate_grid_dimensions(start_stop_index[grid])
+                self.levels[-1].grids.append(self.grid(lo, hi, grid_counter, level, gfn, gfo, dims, start, stop, paranoia=paranoid_read, hierarchy=self))
+                grid_counter += 1 # this is global, and shouldn't be reset
+                                  # for each level
+
+            # already read the filenames above...
+            counter+=nfiles
+            self.num_grids = grid_counter
+            self.float_type = 'float64'
+
+        self.maxLevel = self.n_levels - 1 
+        self.max_level = self.n_levels - 1
+        header_file.close()
+
+    def read_particle_header(self):
+        # We need to get particle offsets and particle counts
+        if not self.parameter_file.use_particles:
+            self.pgrid_info = na.zeros((self.num_grids, 3), dtype='int64')
+            return
+        self.field_list += castro_particle_field_names[:]
+        header = open(os.path.join(self.parameter_file.fullplotdir,
+                        "DM", "Header"))
+        version = header.readline()
+        ndim = header.readline()
+        nfields = header.readline()
+        ntotalpart = int(header.readline())
+        dummy = header.readline() # nextid
+        maxlevel = int(header.readline()) # max level
+        # Skip over how many grids on each level; this is degenerate
+        for i in range(maxlevel+1): dummy = header.readline()
+        grid_info = na.fromiter((int(i)
+                    for line in header.readlines()
+                    for i in line.split()
+                    ),
+            dtype='int64', count=3*self.num_grids).reshape((self.num_grids, 3))
+        self.pgrid_info = grid_info
+
+    def __cache_endianness(self, test_grid):
+        """
+        Cache the endianness and bytes perreal of the grids by using a
+        test grid and assuming that all grids have the same
+        endianness. This is a pretty safe assumption since Castro uses
+        one file per processor, and if you're running on a cluster
+        with different endian processors, then you're on your own!
+        """
+        # open the test file & grab the header
+        inFile = open(os.path.expanduser(test_grid.filename[self.field_list[0]]),'rb')
+        header = inFile.readline()
+        inFile.close()
+        header.strip()
+        
+        # parse it. the patter is in CastroDefs.py
+        headerRe = re.compile(castro_FAB_header_pattern)
+        bytesPerReal, endian, start, stop, centerType, nComponents = headerRe.search(header).groups()
+        self._bytesPerReal = int(bytesPerReal)
+        if self._bytesPerReal == int(endian[0]):
+            dtype = '<'
+        elif self._bytesPerReal == int(endian[-1]):
+            dtype = '>'
+        else:
+            raise ValueError("FAB header is neither big nor little endian. Perhaps the file is corrupt?")
+
+        dtype += ('f%i' % self._bytesPerReal) # always a floating point
+        self._dtype = dtype
+
+    def __calculate_grid_dimensions(self, start_stop):
+        start = na.array(map(int, start_stop[0].split(',')))
+        stop = na.array(map(int, start_stop[1].split(',')))
+        dimension = stop - start + 1
+        return dimension, start, stop
+        
+    def _populate_grid_objects(self):
+        mylog.debug("Creating grid objects")
+        self.grids = na.concatenate([level.grids for level in self.levels])
+        basedir = self.parameter_file.fullplotdir
+        for g, pg in itertools.izip(self.grids, self.pgrid_info):
+            g.particle_filename = os.path.join(
+                basedir, "DM", "Level_%s" % (g.Level), "DATA_%04i" % pg[0])
+            g.NumberOfParticles = pg[1]
+            g._particle_offset = pg[2]
+        self.grid_particle_count[:,0] = self.pgrid_info[:,1]
+        del self.pgrid_info
+        self.grid_levels = na.concatenate([level.ngrids*[level.level] for level in self.levels])
+        self.grid_levels = self.grid_levels.reshape((self.num_grids,1))
+        grid_dcs = na.concatenate([level.ngrids*[self.dx[level.level]] for level in self.levels], axis=0)
+        self.grid_dxs = grid_dcs[:,0].reshape((self.num_grids,1))
+        self.grid_dys = grid_dcs[:,1].reshape((self.num_grids,1))
+        self.grid_dzs = grid_dcs[:,2].reshape((self.num_grids,1))
+        left_edges = []
+        right_edges = []
+        dims = []
+        for level in self.levels:
+            left_edges += [g.LeftEdge for g in level.grids]
+            right_edges += [g.RightEdge for g in level.grids]
+            dims += [g.ActiveDimensions for g in level.grids]
+        self.grid_left_edge = na.array(left_edges)
+        self.grid_right_edge = na.array(right_edges)
+        self.grid_dimensions = na.array(dims)
+        self.gridReverseTree = [] * self.num_grids
+        self.gridReverseTree = [ [] for i in range(self.num_grids)]
+        self.gridTree = [ [] for i in range(self.num_grids)]
+        mylog.debug("Done creating grid objects")
+
+    def _populate_hierarchy(self):
+        self.__setup_grid_tree()
+        #self._setup_grid_corners()
+        for i, grid in enumerate(self.grids):
+            if (i%1e4) == 0: mylog.debug("Prepared % 7i / % 7i grids", i, self.num_grids)
+            grid._prepare_grid()
+            grid._setup_dx()
+
+    def __setup_grid_tree(self):
+        for i, grid in enumerate(self.grids):
+            children = self._get_grid_children(grid)
+            for child in children:
+                self.gridReverseTree[child.id].append(i)
+                self.gridTree[i].append(weakref.proxy(child))
+
+    def _setup_classes(self):
+        dd = self._get_data_reader_dict()
+        dd["field_indexes"] = self.field_indexes
+        AMRHierarchy._setup_classes(self, dd)
+        #self._add_object_class('grid', "CastroGrid", CastroGridBase, dd)
+        self.object_types.sort()
+
+    def _get_grid_children(self, grid):
+        mask = na.zeros(self.num_grids, dtype='bool')
+        grids, grid_ind = self.get_box_grids(grid.LeftEdge, grid.RightEdge)
+        mask[grid_ind] = True
+        mask = na.logical_and(mask, (self.grid_levels == (grid.Level+1)).flat)
+        return self.grids[mask]
+
+    def _setup_field_list(self):
+        self.derived_field_list = []
+        for field in self.field_info:
+            try:
+                fd = self.field_info[field].get_dependencies(pf = self.parameter_file)
+            except:
+                continue
+            available = na.all([f in self.field_list for f in fd.requested])
+            if available: self.derived_field_list.append(field)
+        for field in self.field_list:
+            if field not in self.derived_field_list:
+                self.derived_field_list.append(field)
+        if self.parameter_file.use_particles:
+            # We know which particle fields will exist -- pending further
+            # changes in the future.
+            for field in castro_particle_field_names:
+                def external_wrapper(f):
+                    def _convert_function(data):
+                        return data.convert(f)
+                    return _convert_function
+                cf = external_wrapper(field)
+                # Note that we call add_field on the field_info directly.  This
+                # will allow the same field detection mechanism to work for 1D, 2D
+                # and 3D fields.
+                self.pf.field_info.add_field(
+                        field, lambda a, b: None,
+                        convert_function=cf, take_log=False,
+                        particle_type=True)
+
+    def _count_grids(self):
+        """this is already provided in 
+
+        """
+        pass
+
+    def _initialize_grid_arrays(self):
+        mylog.debug("Allocating arrays for %s grids", self.num_grids)
+        self.grid_dimensions = na.ones((self.num_grids,3), 'int32')
+        self.grid_left_edge = na.zeros((self.num_grids,3), self.float_type)
+        self.grid_right_edge = na.ones((self.num_grids,3), self.float_type)
+        self.grid_levels = na.zeros((self.num_grids,1), 'int32')
+        self.grid_particle_count = na.zeros((self.num_grids,1), 'int32')
+
+    def _parse_hierarchy(self):
+        pass
+    
+    def _detect_fields(self):
+        pass
+
+    def _setup_unknown_fields(self):
+        for field in self.field_list:
+            if field in self.parameter_file.field_info: continue
+            mylog.info("Adding %s to list of fields", field)
+            cf = None
+            if self.parameter_file.has_key(field):
+                def external_wrapper(f):
+                    def _convert_function(data):
+                        return data.convert(f)
+                    return _convert_function
+                cf = external_wrapper(field)
+            add_field(field, lambda a, b: None,
+                      convert_function=cf, take_log=False)
+
+
+    def _setup_derived_fields(self):
+        pass
+
+    def _initialize_state_variables(self):
+        """override to not re-initialize num_grids in AMRHierarchy.__init__
+
+        """
+        self._parallel_locking = False
+        self._data_file = None
+        self._data_mode = None
+        self._max_locations = {}
+    
+class CastroLevel:
+    def __init__(self, level, ngrids):
+        self.level = level
+        self.ngrids = ngrids
+        self.grids = []
+    
+
+class CastroStaticOutput(StaticOutput):
+    """
+    This class is a stripped down class that simply reads and parses
+    *filename*, without looking at the Castro hierarchy.
+    """
+    _hierarchy_class = CastroHierarchy
+    _fieldinfo_class = CastroFieldContainer
+
+    def __init__(self, plotname, paramFilename=None, fparamFilename=None,
+                 data_style='castro_native', paranoia=False,
+                 storage_filename = None):
+        """need to override for Castro file structure.
+
+        the paramfile is usually called "inputs"
+        and there may be a fortran inputs file usually called "probin"
+        plotname here will be a directory name
+        as per BoxLib, data_style will be one of
+         * Native
+         * IEEE (not implemented in yt)
+         * ASCII (not implemented in yt)
+
+        """
+        self.storage_filename = storage_filename
+        self.paranoid_read = paranoia
+        self.parameter_filename = paramFilename
+        self.fparameter_filename = fparamFilename
+        self.__ipfn = paramFilename
+
+        self.fparameters = {}
+
+        StaticOutput.__init__(self, plotname.rstrip("/"),
+                              data_style='castro_native')
+        self.field_info = self._fieldinfo_class()
+
+        # These should maybe not be hardcoded?
+        self.parameters["HydroMethod"] = 'castro' # always PPM DE
+        self.parameters["Time"] = 1. # default unit is 1...
+        self.parameters["DualEnergyFormalism"] = 0 # always off.
+        self.parameters["EOSType"] = -1 # default
+
+        if self.fparameters.has_key("mu"):
+            self.parameters["mu"] = self.fparameters["mu"]
+
+    def _localize(self, f, default):
+        if f is None:
+            return os.path.join(self.directory, default)
+        return f
+
+    @classmethod
+    def _is_valid(cls, *args, **kwargs):
+        # fill our args
+        pname = args[0].rstrip("/")
+        dn = os.path.dirname(pname)
+        if len(args) > 1: kwargs['paramFilename'] = args[1]
+        pfname = kwargs.get("paramFilename", os.path.join(dn, "inputs"))
+
+        # We check for the job_info file's existence because this is currently
+        # what distinguishes Castro data from MAESTRO data.
+        pfn = os.path.join(pfname)
+        if not os.path.exists(pfn): return False
+        castro = any(("castro." in line for line in open(pfn)))
+        maestro = os.path.exists(os.path.join(pname, "job_info"))
+        orion = (not castro) and (not maestro)
+        return castro
+        
+    def _parse_parameter_file(self):
+        """
+        Parses the parameter file and establishes the various
+        dictionaries.
+        """
+        self.fullplotdir = os.path.abspath(self.parameter_filename)
+        self._parse_header_file()
+        self.parameter_filename = self._localize(
+                self.__ipfn, 'inputs')
+        self.fparameter_filename = self._localize(
+                self.fparameter_filename, 'probin')
+        if os.path.isfile(self.fparameter_filename):
+            self._parse_fparameter_file()
+            for param in self.fparameters:
+                if castro2enzoDict.has_key(param):
+                    self.parameters[castro2enzoDict[param]]=self.fparameters[param]
+        # Let's read the file
+        self.unique_identifier = \
+            int(os.stat(self.parameter_filename)[ST_CTIME])
+        lines = open(self.parameter_filename).readlines()
+        for lineI, line in enumerate(lines):
+            if line.find("#") >= 1: # Keep the commented lines...
+                line=line[:line.find("#")]
+            line=line.strip().rstrip()
+            if len(line) < 2 or line.find("#") == 0: # ...but skip comments
+                continue
+            try:
+                param, vals = map(strip, map(rstrip, line.split("=")))
+            except ValueError:
+                mylog.error("ValueError: '%s'", line)
+            if castro2enzoDict.has_key(param):
+                paramName = castro2enzoDict[param]
+                t = map(parameterDict[paramName], vals.split())
+                if len(t) == 1:
+                    self.parameters[paramName] = t[0]
+                else:
+                    if paramName == "RefineBy":
+                        self.parameters[paramName] = t[0]
+                    else:
+                        self.parameters[paramName] = t
+                
+            elif param.startswith("geometry.prob_hi"):
+                self.domain_right_edge = \
+                    na.array([float(i) for i in vals.split()])
+            elif param.startswith("geometry.prob_lo"):
+                self.domain_left_edge = \
+                    na.array([float(i) for i in vals.split()])
+            elif param.startswith("castro.do_dm_particles"):
+                self.use_particles = True
+
+        self.parameters["TopGridRank"] = len(self.parameters["TopGridDimensions"])
+        self.dimensionality = self.parameters["TopGridRank"]
+        self.domain_dimensions = self.parameters["TopGridDimensions"]
+        self.refine_by = self.parameters.get("RefineBy", 2)
+
+        if self.parameters.has_key("ComovingCoordinates") and bool(self.parameters["ComovingCoordinates"]):
+            self.cosmological_simulation = 1
+            self.omega_lambda = self.parameters["CosmologyOmegaLambdaNow"]
+            self.omega_matter = self.parameters["CosmologyOmegaMatterNow"]
+            self.hubble_constant = self.parameters["CosmologyHubbleConstantNow"]
+            a_file = open(os.path.join(self.fullplotdir,'comoving_a'))
+            line = a_file.readline().strip()
+            a_file.close()
+            self.parameters["CosmologyCurrentRedshift"] = 1/float(line) - 1
+            self.current_redshift = self.parameters["CosmologyCurrentRedshift"]
+        else:
+            self.current_redshift = self.omega_lambda = self.omega_matter = \
+                self.hubble_constant = self.cosmological_simulation = 0.0
+
+    def _parse_fparameter_file(self):
+        """
+        Parses the fortran parameter file for Castro. Most of this will
+        be useless, but this is where it keeps mu = mass per
+        particle/m_hydrogen.
+        """
+        lines = open(self.fparameter_filename).readlines()
+        for line in lines:
+            if line.count("=") == 1:
+                param, vals = map(strip, map(rstrip, line.split("=")))
+                if vals.count("'") == 0:
+                    t = map(float,[a.replace('D','e').replace('d','e') for a in vals.split()]) # all are floating point.
+                else:
+                    t = vals.split()
+                if len(t) == 1:
+                    self.fparameters[param] = t[0]
+                else:
+                    self.fparameters[param] = t
+
+    def _parse_header_file(self):
+        """
+        Parses the BoxLib header file to get any parameters stored
+        there. Hierarchy information is read out of this file in
+        CastroHierarchy. 
+
+        Currently, only Time is read here.
+        """
+        header_file = open(os.path.join(self.fullplotdir,'Header'))
+        lines = header_file.readlines()
+        header_file.close()
+        n_fields = int(lines[1])
+        self.current_time = float(lines[3+n_fields])
+
+
+                
+    def _set_units(self):
+        """
+        Generates the conversion to various physical _units based on the parameter file
+        """
+        self.units = {}
+        self.time_units = {}
+        if len(self.parameters) == 0:
+            self._parse_parameter_file()
+        self._setup_nounits_units()
+        self.conversion_factors = defaultdict(lambda: 1.0)
+        self.time_units['1'] = 1
+        self.units['1'] = 1.0
+        self.units['unitary'] = 1.0 / (self.domain_right_edge - self.domain_left_edge).max()
+        seconds = 1 #self["Time"]
+        self.time_units['years'] = seconds / (365*3600*24.0)
+        self.time_units['days']  = seconds / (3600*24.0)
+        for key in yt2castroFieldsDict:
+            self.conversion_factors[key] = 1.0
+        for key in castro_particle_field_names:
+            self.conversion_factors[key] = 1.0
+
+    def _setup_nounits_units(self):
+        z = 0
+        mylog.warning("Setting 1.0 in code units to be 1.0 cm")
+        if not self.has_key("TimeUnits"):
+            mylog.warning("No time units.  Setting 1.0 = 1 second.")
+            self.conversion_factors["Time"] = 1.0
+        for unit in mpc_conversion.keys():
+            self.units[unit] = mpc_conversion[unit] / mpc_conversion["cm"]
+


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,81 @@
+"""
+Various definitions for various other modules and routines
+
+Author: J. S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2008-20010 J.S. Oishi.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""
+from yt.funcs import *
+
+# TODO: get rid of enzo parameters we do not need
+parameterDict = {"CosmologyCurrentRedshift": float,
+                 "CosmologyComovingBoxSize": float,
+                 "CosmologyOmegaMatterNow": float,
+                 "CosmologyOmegaLambdaNow": float,
+                 "CosmologyHubbleConstantNow": float,
+                 "CosmologyInitialRedshift": float,
+                 "DualEnergyFormalismEta1": float,
+                 "DualEnergyFormalismEta2": float,
+                 "MetaDataString": str,
+                 "HydroMethod": int,
+                 "DualEnergyFormalism": int,
+                 "InitialTime": float,
+                 "ComovingCoordinates": int,
+                 "DensityUnits": float,
+                 "LengthUnits": float,
+                 "LengthUnit": float,
+                 "TemperatureUnits": float,
+                 "TimeUnits": float,
+                 "GravitationalConstant": float,
+                 "Gamma": float,
+                 "MultiSpecies": int,
+                 "CompilerPrecision": str,
+                 "CurrentTimeIdentifier": int,
+                 "RefineBy": int,
+                 "BoundaryConditionName": str,
+                 "TopGridRank": int,
+                 "TopGridDimensions": int,
+                 "EOSSoundSpeed": float,
+                 "EOSType": int,
+                 "NumberOfParticleAttributes": int,
+                }
+
+# converts the Castro inputs file name to the Enzo/yt name expected
+# throughout the code. key is Castro name, value is Enzo/yt equivalent
+castro2enzoDict = {"amr.n_cell": "TopGridDimensions",
+                  "materials.gamma": "Gamma",
+                  "amr.ref_ratio": "RefineBy",
+                  "castro.use_comoving": "ComovingCoordinates",
+                  "castro.redshift_in": "CosmologyInitialRedshift",
+                  "comoving_OmL": "CosmologyOmegaLambdaNow",
+                  "comoving_OmM": "CosmologyOmegaMatterNow",
+                  "comoving_h": "CosmologyHubbleConstantNow"
+                  }
+
+yt2castroFieldsDict = {}
+castro2ytFieldsDict = {}
+
+castro_FAB_header_pattern = r"^FAB \(\((\d+), \([0-9 ]+\)\),\(\d+, \(([0-9 ]+)\)\)\)\(\((\d+,\d+,\d+)\) \((\d+,\d+,\d+)\) \((\d+,\d+,\d+)\)\) (\d+)\n"
+
+castro_particle_field_names = \
+    ['particle_position_%s' % ax for ax in 'xyz'] + \
+    ['particle_mass'] +  \
+    ['particle_velocity_%s' % ax for ax in 'xyz'] 


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,154 @@
+"""
+Castro-specific fields
+
+Author: J. S. Oishi <jsoishi at gmail.com>
+Affiliation: UC Berkeley
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2008-2010 J. S. Oishi, Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+from yt.utilities.physical_constants import \
+    mh, kboltz
+from yt.data_objects.field_info_container import \
+    CodeFieldInfoContainer, \
+    ValidateParameter, \
+    ValidateDataField, \
+    ValidateProperty, \
+    ValidateSpatial, \
+    ValidateGridType
+import yt.data_objects.universal_fields
+
+class CastroFieldContainer(CodeFieldInfoContainer):
+    """
+    All Castro-specific fields are stored in here.
+    """
+    _shared_state = {}
+    _field_list = {}
+CastroFieldInfo = CastroFieldContainer()
+add_castro_field = CastroFieldInfo.add_field
+
+
+add_field = add_castro_field
+
+# def _convertDensity(data):
+#     return data.convert("Density")
+add_field("density", function=lambda a, b: None, take_log=True,
+          validators = [ValidateDataField("density")],
+          units=r"\rm{g}/\rm{cm}^3")
+CastroFieldInfo["density"]._projected_units =r"\rm{g}/\rm{cm}^2"
+#CastroFieldInfo["density"]._convert_function=_convertDensity
+
+add_field("eden", function=lambda a, b: None, take_log=True,
+          validators = [ValidateDataField("eden")],
+          units=r"\rm{erg}/\rm{cm}^3")
+
+add_field("xmom", function=lambda a, b: None, take_log=False,
+          validators = [ValidateDataField("xmom")],
+          units=r"\rm{g}/\rm{cm^2\ s}")
+
+add_field("ymom", function=lambda a, b: None, take_log=False,
+          validators = [ValidateDataField("ymom")],
+          units=r"\rm{gm}/\rm{cm^2\ s}")
+
+add_field("zmom", function=lambda a, b: None, take_log=False,
+          validators = [ValidateDataField("zmom")],
+          units=r"\rm{g}/\rm{cm^2\ s}")
+
+translation_dict = {"x-velocity": "xvel",
+                    "y-velocity": "yvel",
+                    "z-velocity": "zvel",
+                    "Density": "density",
+                    "Total_Energy": "eden",
+                    "Temperature": "temperature",
+                    "x-momentum": "xmom",
+                    "y-momentum": "ymom",
+                    "z-momentum": "zmom"
+                   }
+
+def _generate_translation(mine, theirs):
+    add_field(theirs, function=lambda a, b: b[mine], take_log=True)
+
+for f, v in translation_dict.items():
+    if v not in CastroFieldInfo:
+        add_field(v, function=lambda a, b: None, take_log=False,
+                  validators = [ValidateDataField(v)])
+    #print "Setting up translator from %s to %s" % (v, f)
+    _generate_translation(v, f)
+
+def _xVelocity(field, data):
+    """generate x-velocity from x-momentum and density
+
+    """
+    return data["xmom"]/data["density"]
+add_field("x-velocity", function=_xVelocity, take_log=False,
+          units=r'\rm{cm}/\rm{s}')
+
+def _yVelocity(field, data):
+    """generate y-velocity from y-momentum and density
+
+    """
+    #try:
+    #    return data["xvel"]
+    #except KeyError:
+    return data["ymom"]/data["density"]
+add_field("y-velocity", function=_yVelocity, take_log=False,
+          units=r'\rm{cm}/\rm{s}')
+
+def _zVelocity(field, data):
+    """generate z-velocity from z-momentum and density
+
+    """
+    return data["zmom"]/data["density"]
+add_field("z-velocity", function=_zVelocity, take_log=False,
+          units=r'\rm{cm}/\rm{s}')
+
+def _ThermalEnergy(field, data):
+    """generate thermal (gas energy). Dual Energy Formalism was
+        implemented by Stella, but this isn't how it's called, so I'll
+        leave that commented out for now.
+    """
+    #if data.pf["DualEnergyFormalism"]:
+    #    return data["Gas_Energy"]
+    #else:
+    return data["Total_Energy"] - 0.5 * data["density"] * (
+        data["x-velocity"]**2.0
+        + data["y-velocity"]**2.0
+        + data["z-velocity"]**2.0 )
+add_field("ThermalEnergy", function=_ThermalEnergy,
+          units=r"\rm{ergs}/\rm{cm^3}")
+
+def _Pressure(field, data):
+    """M{(Gamma-1.0)*e, where e is thermal energy density
+       NB: this will need to be modified for radiation
+    """
+    return (data.pf["Gamma"] - 1.0)*data["ThermalEnergy"]
+add_field("Pressure", function=_Pressure, units=r"\rm{dyne}/\rm{cm}^{2}")
+
+def _Temperature(field, data):
+    return (data.pf["Gamma"]-1.0)*data.pf["mu"]*mh*data["ThermalEnergy"]/(kboltz*data["Density"])
+add_field("Temperature", function=_Temperature, units=r"\rm{Kelvin}", take_log=False)
+
+def _convertParticleMassMsun(data):
+    return 1.0/1.989e33
+def _ParticleMassMsun(field, data):
+    return data["particle_mass"]
+add_field("ParticleMassMsun",
+          function=_ParticleMassMsun, validators=[ValidateSpatial(0)],
+          particle_type=True, convert_function=_convertParticleMassMsun,
+          particle_convert_function=_ParticleMassMsun)
+


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/io.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,145 @@
+"""
+Castro data-file handling functions
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Author: J. S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+import os
+import numpy as na
+from yt.utilities.io_handler import \
+           BaseIOHandler
+from yt.utilities.amr_utils import \
+            read_castro_particles
+
+from definitions import \
+    yt2castroFieldsDict, \
+    castro_particle_field_names
+
+class IOHandlerNative(BaseIOHandler):
+
+    _data_style = "castro_native"
+
+    def modify(self, field):
+        return field.swapaxes(0,2)
+
+    def _read_particle_field(self, grid, field):
+        offset = grid._particle_offset
+        filen = os.path.expanduser(grid.particle_filename)
+        off = grid._particle_offset
+        tr = na.zeros(grid.NumberOfParticles, dtype='float64')
+        read_castro_particles(filen, off,
+            castro_particle_field_names.index(field),
+            len(castro_particle_field_names),
+            tr)
+        return tr
+
+    def _read_data_set(self, grid, field):
+        """
+        reads packed multiFABs output by BoxLib in "NATIVE" format.
+
+        """
+        if field in castro_particle_field_names:
+            return self._read_particle_field(grid, field)
+        filen = os.path.expanduser(grid.filename[field])
+        off = grid._offset[field]
+        inFile = open(filen,'rb')
+        inFile.seek(off)
+        header = inFile.readline()
+        header.strip()
+
+        if grid._paranoid:
+            mylog.warn("Castro Native reader: Paranoid read mode.")
+            headerRe = re.compile(castro_FAB_header_pattern)
+            bytesPerReal, endian, start, stop, centerType, nComponents = headerRe.search(header).groups()
+
+            # we will build up a dtype string, starting with endian
+            # check endianness (this code is ugly. fix?)
+            bytesPerReal = int(bytesPerReal)
+            if bytesPerReal == int(endian[0]):
+                dtype = '<'
+            elif bytesPerReal == int(endian[-1]):
+                dtype = '>'
+            else:
+                raise ValueError("FAB header is neither big nor little endian. Perhaps the file is corrupt?")
+
+            dtype += ('f%i'% bytesPerReal) #always a floating point
+
+            # determine size of FAB
+            start = na.array(map(int, start.split(',')))
+            stop = na.array(map(int, stop.split(',')))
+
+            gridSize = stop - start + 1
+
+            error_count = 0
+            if (start != grid.start).any():
+                print "Paranoia Error: Cell_H and %s do not agree on grid start." %grid.filename
+                error_count += 1
+            if (stop != grid.stop).any():
+                print "Paranoia Error: Cell_H and %s do not agree on grid stop." %grid.filename
+                error_count += 1
+            if (gridSize != grid.ActiveDimensions).any():
+                print "Paranoia Error: Cell_H and %s do not agree on grid dimensions." %grid.filename
+                error_count += 1
+            if bytesPerReal != grid.hierarchy._bytesPerReal:
+                print "Paranoia Error: Cell_H and %s do not agree on bytes per real number." %grid.filename
+                error_count += 1
+            if (bytesPerReal == grid.hierarchy._bytesPerReal and dtype != grid.hierarchy._dtype):
+                print "Paranoia Error: Cell_H and %s do not agree on endianness." %grid.filename
+                error_count += 1
+
+            if error_count > 0:
+                raise RunTimeError("Paranoia unveiled %i differences between Cell_H and %s." % (error_count, grid.filename))
+
+        else:
+            start = grid.start_index
+            stop = grid.stop_index
+            dtype = grid.hierarchy._dtype
+            bytesPerReal = grid.hierarchy._bytesPerReal
+
+        nElements = grid.ActiveDimensions.prod()
+
+        # one field has nElements*bytesPerReal bytes and is located
+        # nElements*bytesPerReal*field_index from the offset location
+        if yt2castroFieldsDict.has_key(field):
+            fieldname = yt2castroFieldsDict[field]
+        else:
+            fieldname = field
+        field_index = grid.field_indexes[fieldname]
+        inFile.seek(int(nElements*bytesPerReal*field_index),1)
+        field = na.fromfile(inFile, count=nElements, dtype=dtype)
+        field = field.reshape(grid.ActiveDimensions[::-1]).swapaxes(0,2)
+
+        # we can/should also check against the max and min in the header file
+
+        inFile.close()
+        return field
+
+    def _read_data_slice(self, grid, field, axis, coord):
+        """wishful thinking?
+        """
+        sl = [slice(None), slice(None), slice(None)]
+        sl[axis] = slice(coord, coord + 1)
+        #sl = tuple(reversed(sl))
+        return self._read_data_set(grid, field)[sl]
+
+


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/frontends/castro/setup.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+import setuptools
+import os, sys, os.path
+
+import os.path
+
+def configuration(parent_package='', top_path=None):
+    from numpy.distutils.misc_util import Configuration
+    config = Configuration('castro', parent_package, top_path)
+    config.make_config_py() # installs __config__.py
+    config.make_svn_version_py()
+    return config


--- a/yt/frontends/chombo/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/chombo/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.Chombotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/chombo/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/chombo/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 Matthew Turk, J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk, J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/chombo/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/chombo/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-20010 J.S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J.S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/chombo/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/chombo/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2009-2010 J. S. Oishi, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2009-2011 J. S. Oishi, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/chombo/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/chombo/io.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/enzo/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/enzo/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -415,8 +415,13 @@
                         return data.convert(f)
                     return _convert_function
                 cf = external_wrapper(field)
-            add_enzo_field(field, lambda a, b: None,
-                           convert_function=cf, take_log=False)
+            # Note that we call add_field on the field_info directly.  This
+            # will allow the same field detection mechanism to work for 1D, 2D
+            # and 3D fields.
+            self.pf.field_info.add_field(
+                    field, lambda a, b: None,
+                    convert_function=cf, take_log=False)
+            
 
     def _setup_derived_fields(self):
         self.derived_field_list = []


--- a/yt/frontends/enzo/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Homepage: http://yt.enzotools.org/
 
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/enzo/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -118,21 +118,19 @@
           validators=ValidateDataField("SN_Colour"),
           projection_conversion="1")
 
-def _Cooling_Time(field, data):
-    return data["Cooling_Time"]
 add_field("Cooling_Time", units=r"\rm{s}",
-          function=_Cooling_Time,
+          function=lambda a, b: None,
           validators=ValidateDataField("Cooling_Time"),
           projection_conversion="1")
 
 def _ThermalEnergy(field, data):
     if data.pf["HydroMethod"] == 2:
-        return data["Total_Energy"]
+        return data["TotalEnergy"]
     else:
         if data.pf["DualEnergyFormalism"]:
             return data["GasEnergy"]
         else:
-            return data["Total_Energy"] - 0.5*(
+            return data["TotalEnergy"] - 0.5*(
                    data["x-velocity"]**2.0
                  + data["y-velocity"]**2.0
                  + data["z-velocity"]**2.0 )
@@ -156,9 +154,7 @@
 def _convertEnergy(data):
     return data.convert("x-velocity")**2.0
 
-def _GasEnergy(field, data):
-    return data["Gas_Energy"] / _convertEnergy(data)
-add_field("GasEnergy", function=_GasEnergy,
+add_field("GasEnergy", function=lambda a, b: None,
           units=r"\rm{ergs}/\rm{g}", convert_function=_convertEnergy)
 
 def _Gas_Energy(field, data):
@@ -166,9 +162,7 @@
 add_field("Gas_Energy", function=_Gas_Energy,
           units=r"\rm{ergs}/\rm{g}", convert_function=_convertEnergy)
 
-def _TotalEnergy(field, data):
-    return data["Total_Energy"] / _convertEnergy(data)
-add_field("TotalEnergy", function=_TotalEnergy,
+add_field("TotalEnergy", function=lambda a, b: None,
           display_name = "\mathrm{Total}\/\mathrm{Energy}",
           units=r"\rm{ergs}/\rm{g}", convert_function=_convertEnergy)
 


--- a/yt/frontends/enzo/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/enzo/misc.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/enzo/misc.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/flash/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/flash/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/flash/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/flash/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/flash/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/flash/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/flash/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/flash/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk, John ZuHone.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk, John ZuHone.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -61,8 +61,8 @@
                     "y-velocity": "vely",
                     "z-velocity": "velz",
                     "Density": "dens",
-                    "Total_Energy": "ener",
-                    "Gas_Energy": "eint",
+                    "TotalEnergy": "ener",
+                    "GasEnergy": "eint",
                     "Temperature": "temp",
                     "particle_position_x" : "particle_posx",
                     "particle_position_y" : "particle_posy",


--- a/yt/frontends/flash/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/flash/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gadget/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gadget/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gadget/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gadget/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gadget/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gadget/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: UCSC
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gadget/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gadget/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC Santa Cruz
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Christopher E Moody, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Christopher E Moody, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gadget/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gadget/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC Santa Cruz
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Christopher E Moody, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Christopher E Moody, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gdf/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gdf/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.Chombotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gdf/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gdf/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 Matthew Turk, J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk, J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gdf/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gdf/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-20010 J.S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J.S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gdf/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gdf/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2009-2010 J. S. Oishi, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2009-2011 J. S. Oishi, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/gdf/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/gdf/io.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -11,7 +11,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/api.py	Mon May 09 15:14:08 2011 -0700
@@ -11,7 +11,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-20010 J.S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J.S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 J. S. Oishi, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 J. S. Oishi, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/maestro/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/maestro/io.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: SUNY Stony Brook
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/orion/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/orion/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/orion/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -489,8 +489,12 @@
 
         # We check for the job_info file's existence because this is currently
         # what distinguishes Orion data from MAESTRO data.
-        return ( os.path.exists(os.path.join(pfname)) and 
-                 not os.path.exists(os.path.join(pname, "job_info")))
+        pfn = os.path.join(pfname)
+        if not os.path.exists(pfn): return False
+        castro = any(("castro." in line for line in open(pfn)))
+        maestro = os.path.exists(os.path.join(pname, "job_info"))
+        orion = (not castro) and (not maestro)
+        return orion
         
     def _parse_parameter_file(self):
         """


--- a/yt/frontends/orion/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-20010 J.S. Oishi.  All Rights Reserved.
+  Copyright (C) 2008-2011 J.S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/orion/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC Berkeley
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2010 J. S. Oishi, Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 J. S. Oishi, Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -73,7 +73,7 @@
                     "y-velocity": "yvel",
                     "z-velocity": "zvel",
                     "Density": "density",
-                    "Total_Energy": "eden",
+                    "TotalEnergy": "eden",
                     "Temperature": "temperature",
                     "x-momentum": "xmom",
                     "y-momentum": "ymom",
@@ -123,9 +123,9 @@
         leave that commented out for now.
     """
     #if data.pf["DualEnergyFormalism"]:
-    #    return data["Gas_Energy"]
+    #    return data["GasEnergy"]
     #else:
-    return data["Total_Energy"] - 0.5 * data["density"] * (
+    return data["TotalEnergy"] - 0.5 * data["density"] * (
         data["x-velocity"]**2.0
         + data["y-velocity"]**2.0
         + data["z-velocity"]**2.0 )


--- a/yt/frontends/orion/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/orion/io.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/_ramses_reader.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/_ramses_reader.pyx	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC / Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/ramses/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/ramses/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/setup.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/setup.py	Mon May 09 15:14:08 2011 -0700
@@ -14,4 +14,5 @@
     config.add_subpackage("tiger")
     config.add_subpackage("art")
     config.add_subpackage("maestro")
+    config.add_subpackage("castro")
     return config


--- a/yt/frontends/tiger/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/tiger/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/tiger/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/tiger/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/tiger/data_structures.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/tiger/data_structures.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/tiger/fields.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/tiger/fields.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/frontends/tiger/io.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/frontends/tiger/io.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/funcs.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/funcs.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -124,7 +124,10 @@
     """
     Returning resident size in megabytes
     """
-    pagesize = resource.getpagesize()
+    try:
+        pagesize = resource.getpagesize()
+    except NameError:
+        return 0
     pid = os.getpid()
     status_file = "/proc/%s/statm" % (pid)
     if not os.path.isfile(status_file):


--- a/yt/gui/opengl_widgets/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/opengl_widgets/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/gui/opengl_widgets/mip_viewer.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/opengl_widgets/mip_viewer.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation:  UCSD
 License:
-  Copyright (C) 2010 Matthew Turk  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/gui/opengl_widgets/rendering_contexts.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/opengl_widgets/rendering_contexts.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation:  UCSD
 License:
-  Copyright (C) 2010 Matthew Turk  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/gui/opengl_widgets/small_apps.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/opengl_widgets/small_apps.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation:  UCSD
 License:
-  Copyright (C) 2010 Matthew Turk  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/gui/reason/basic_repl.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/basic_repl.py	Mon May 09 15:14:08 2011 -0700
@@ -4,7 +4,7 @@
 with the terms of its original license.
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/gui/reason/bottle_mods.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/bottle_mods.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 yt's purposes
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
@@ -136,10 +136,10 @@
         return rv
 
 def uuid_serve_functions(pre_routed = None, open_browser=False, port=9099,
-                         repl = None):
+                         repl = None, token = None):
     if pre_routed == None: pre_routed = route_functions
     debug(mode=True)
-    token = uuid.uuid1()
+    if token is None: token = uuid.uuid1()
     for r in pre_routed:
         args, kwargs, f = pre_routed[r]
         if r[0] == "/": r = r[1:]


--- a/yt/gui/reason/extdirect_repl.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/extdirect_repl.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 commands through ExtDirect calls
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
@@ -34,6 +34,11 @@
 import urllib
 import urllib2
 import pprint
+import traceback
+import tempfile
+import base64
+import imp
+import threading
 
 from yt.funcs import *
 from yt.utilities.logger import ytLogger, ufstring
@@ -45,7 +50,6 @@
                          PayloadHandler
 from .bottle import response, request, route
 from .basic_repl import ProgrammaticREPL
-import threading
 
 try:
     import pygments
@@ -91,6 +95,54 @@
 
 lockit = MethodLock()
 
+def deliver_image(im):
+    if hasattr(im, 'read'):
+        img_data = base64.b64encode(im.read())
+    elif isinstance(im, types.StringTypes) and \
+         im.endswith(".png"):
+        img_data = base64.b64encode(open(im).read())
+    elif isinstance(im, types.StringTypes):
+        img_data = im
+    else:
+        raise RuntimeError
+    ph = PayloadHandler()
+    payload = {'type':'png_string',
+               'image_data':img_data}
+    ph.add_payload(payload)
+
+def reason_pylab():
+    def _canvas_deliver(canvas):
+        tf = tempfile.TemporaryFile()
+        canvas.print_png(tf)
+        tf.seek(0)
+        img_data = base64.b64encode(tf.read())
+        tf.close()
+        deliver_image(img_data)
+    def reason_draw_if_interactive():
+        if matplotlib.is_interactive():
+            figManager =  Gcf.get_active()
+            if figManager is not None:
+                _canvas_deliver(figManager.canvas)
+    def reason_show(mainloop = True):
+        # We ignore mainloop here
+        for manager in Gcf.get_all_fig_managers():
+            _canvas_deliver(manager.canvas)
+    # Matplotlib has very nice backend overriding.
+    # We should really use that.  This is just a hack.
+    import matplotlib
+    new_agg = imp.new_module("reason_agg")
+    import matplotlib.backends.backend_agg as bagg
+    new_agg.__dict__.update(bagg.__dict__)
+    new_agg.__dict__.update(
+        {'show': reason_show,
+         'draw_if_interactive': reason_draw_if_interactive})
+    sys.modules["reason_agg"] = new_agg
+    bagg.draw_if_interactive = reason_draw_if_interactive
+    from matplotlib._pylab_helpers import Gcf
+    import pylab, matplotlib
+    matplotlib.rcParams["backend"] = "module://reason_agg"
+    pylab.switch_backend("module://reason_agg")
+
 class ExtDirectREPL(ProgrammaticREPL, BottleDirectRouter):
     _skip_expose = ('index')
     my_name = "ExtDirectREPL"
@@ -131,15 +183,24 @@
         self.payload_handler = PayloadHandler()
         # Now we load up all the yt.mods stuff, but only after we've finished
         # setting up.
-        self.execute("from yt.mods import *")
+        reason_pylab()
+        self.execute("from yt.mods import *\nimport pylab\npylab.ion()")
         self.execute("from yt.data_objects.static_output import _cached_pfs", hide = True)
+        self.execute("data_objects = []", hide = True)
         self.locals['load_script'] = ext_load_script
+        self.locals['deliver_image'] = deliver_image
         self._setup_logging_handlers()
 
         # Setup our heartbeat
         self.last_heartbeat = time.time()
         self._check_heartbeat()
 
+    def exception_handler(self, exc):
+        result = {'type': 'cell_results',
+                  'input': 'ERROR HANDLING IN REASON',
+                  'output': traceback.format_exc()}
+        return result
+
     def _setup_logging_handlers(self):
         handler = PayloadLoggingHandler()
         formatter = logging.Formatter(ufstring)
@@ -333,6 +394,28 @@
         return command
 
     @lockit
+    def create_phase(self, objname, field_x, field_y, field_z, weight):
+        if weight == "None": weight = None
+        else: weight = "'%s'" % (weight)
+        funccall = """
+        _tfield_x = "%(field_x)s"
+        _tfield_y = "%(field_y)s"
+        _tfield_z = "%(field_z)s"
+        _tweight = %(weight)s
+        _tobj = %(objname)s
+        _tpf = _tobj.pf
+        from yt.visualization.profile_plotter import PhasePlotterExtWidget
+        _tpp = PhasePlotterExtWidget(_tobj, _tfield_x, _tfield_y, _tfield_z, _tweight)
+        _tfield_list = list(set(_tpf.h.field_list + _tpf.h.derived_field_list))
+        _tfield_list.sort()
+        _twidget_data = {'title': "%%s Phase Plot" %% (_tobj)}
+        """ % dict(objname = objname, field_x = field_x, field_y = field_y,
+                   field_z = field_z, weight = weight)
+        funccall = "\n".join(line.strip() for line in funccall.splitlines())
+        self.execute(funccall, hide=True)
+        self.execute(self._add_widget('_tpp', '_twidget_data'), hide=True)
+
+    @lockit
     def create_proj(self, pfname, axis, field, weight, onmax):
         if weight == "None": weight = None
         else: weight = "'%s'" % (weight)
@@ -351,13 +434,14 @@
         DLE, DRE = _tpf.domain_left_edge, _tpf.domain_right_edge
         from yt.visualization.plot_window import PWViewerExtJS
         _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]), setup = False)
-        _tpw._current_field = _tfield
-        _tpw._field_transform["%(field)s"] = na.log
+        _tpw.set_current_field("%(field)s")
         _tfield_list = list(set(_tpf.h.field_list + _tpf.h.derived_field_list))
         _tfield_list.sort()
+        _tcb = _tpw._get_cbar_image()
         _twidget_data = {'fields': _tfield_list,
                          'initial_field': _tfield,
-                         'title': "%%s Projection" %% (_tpf)}
+                         'title': "%%s Projection" %% (_tpf),
+                         'colorbar': _tcb}
         """ % dict(pfname = pfname,
                    axis = inv_axis_names[axis],
                    weight = weight,
@@ -389,13 +473,14 @@
         DLE, DRE = _tpf.domain_left_edge, _tpf.domain_right_edge
         from yt.visualization.plot_window import PWViewerExtJS
         _tpw = PWViewerExtJS(_tsl, (DLE[_txax], DRE[_txax], DLE[_tyax], DRE[_tyax]), setup = False)
-        _tpw._current_field = _tfield
-        _tpw.set_log(_tfield, True)
+        _tpw.set_current_field("%(field)s")
         _tfield_list = list(set(_tpf.h.field_list + _tpf.h.derived_field_list))
         _tfield_list.sort()
+        _tcb = _tpw._get_cbar_image()
         _twidget_data = {'fields': _tfield_list,
                          'initial_field': _tfield,
-                         'title': "%%s Slice" %% (_tpf)}
+                         'title': "%%s Slice" %% (_tpf),
+                         'colorbar': _tcb}
         """ % dict(pfname = pfname,
                    center_string = center_string,
                    axis = inv_axis_names[axis],
@@ -406,6 +491,39 @@
         self.execute(self._add_widget('_tpw', '_twidget_data'), hide = True)
 
     @lockit
+    def create_grid_dataview(self, pfname):
+        funccall = """
+        _tpf = %(pfname)s
+        """ % dict(pfname = pfname)
+        funccall = "\n".join((line.strip() for line in funccall.splitlines()))
+        self.execute(funccall, hide = True)
+        pf = self.locals['_tpf']
+        levels = pf.h.grid_levels
+        left_edge = pf.h.grid_left_edge
+        right_edge = pf.h.grid_right_edge
+        dimensions = pf.h.grid_dimensions
+        cell_counts = pf.h.grid_dimensions.prod(axis=1)
+        # This is annoying, and not ... that happy for memory.
+        i = pf.h.grids[0]._id_offset
+        vals = []
+        for i, (L, LE, RE, dim, cell) in enumerate(zip(
+            levels, left_edge, right_edge, dimensions, cell_counts)):
+            vals.append([ int(i), int(L[0]),
+                          float(LE[0]), float(LE[1]), float(LE[2]),
+                          float(RE[0]), float(RE[1]), float(RE[2]),
+                          int(dim[0]), int(dim[1]), int(dim[2]),
+                          int(cell)] )
+        uu = str(uuid.uuid1()).replace("-","_")
+        varname = "gg_%s" % (uu)
+        payload = {'type': 'widget',
+                   'widget_type': 'grid_data',
+                   'varname': varname, # Is just "None"
+                   'data': dict(gridvals = vals),
+                   }
+        self.execute("%s = None\n" % (varname), hide=True)
+        self.payload_handler.add_payload(payload)
+
+    @lockit
     def create_grid_viewer(self, pfname):
         funccall = """
         _tpf = %(pfname)s
@@ -489,6 +607,24 @@
         self.execute("%s = None\n" % (varname), hide=True)
         self.payload_handler.add_payload(payload)
 
+    @lockit
+    def object_creator(self, pfname, objtype, objargs):
+        funccall = "_tobjargs = {}\n"
+        for argname, argval in objargs.items():
+            # These arguments may need further sanitization
+            if isinstance(argval, types.StringTypes):
+                argval = "'%s'" % argval
+            funccall += "_tobjargs['%(argname)s'] = %(argval)s\n" % dict(
+                    argname = argname, argval = argval)
+        funccall += """
+        _tpf = %(pfname)s
+        _tobjclass = getattr(_tpf.h, '%(objtype)s')
+        data_objects.append(_tobjclass(**_tobjargs))
+        """ % dict(pfname = pfname, objtype = objtype)
+        funccall = "\n".join((line.strip() for line in funccall.splitlines()))
+        self.execute(funccall, hide = False)
+        pf = self.locals['_tpf']
+
 class ExtDirectParameterFileList(BottleDirectRouter):
     my_name = "ExtDirectParameterFileList"
     api_url = "pflist"


--- a/yt/gui/reason/extdirect_router.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/extdirect_router.py	Mon May 09 15:14:08 2011 -0700
@@ -40,6 +40,7 @@
 
     Call an instance of this class with the JSON from an Ext.Direct request.
     """
+    exception_handler = None
     def __call__(self, body):
         """
         """
@@ -98,7 +99,13 @@
         self._data = data
 
         # Finally, call the target method, passing in the data
-        result = _targetfn(**data)
+        try:
+            result = _targetfn(**data)
+        except Exception as e:
+            if self.exception_handler is not None:
+                result = self.exception_handler(e)
+            else:
+                raise e
 
         return {
             'type':'rpc',


--- a/yt/gui/reason/html/index.html	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/index.html	Mon May 09 15:14:08 2011 -0700
@@ -106,6 +106,13 @@
 
     <!-- THE PROGRESS BAR FUNCTIONS --><script type="text/javascript" src="js/widget_progressbar.js"></script>
+
+    <!-- THE GRID DATA VIEWER FUNCTIONS -->
+    <script type="text/javascript" src="js/widget_griddata.js"></script>
+
+    <!-- THE PHASE PLOT VIEWER FUNCTIONS -->
+    <script type="text/javascript" src="js/widget_phaseplot.js"></script>
+
     <script id="gv-shader-fs" type="x-shader/x-fragment">
     #ifdef GL_ES
     precision highp float;


--- a/yt/gui/reason/html/js/functions.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/functions.js	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 Author: Britton Smith <brittonsmith at gmail.com>
 Affiliation: MSU
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
@@ -106,6 +106,8 @@
         } else if (payload['type'] == 'widget_payload') {
             var widget = widget_list[payload['widget_id']];
             widget.accept_results(payload);
+        } else {
+            alert("Didn't know how to process " + payload['type']);
         }
     });
     if (new_log == true){
@@ -140,11 +142,13 @@
             iconCls: 'pf_icon'}));
         this_pf = treePanel.root.lastChild
         Ext.each(pf.objects, function(obj, obj_index) {
+            examine = this_pf;
             this_pf.appendChild(new Ext.tree.TreeNode(
                 {text: obj.name,
                  leaf: true,
                  iconCls: 'data_obj',
-                 objdata: {varname: obj.varname, type: 'obj'},
+                 objdata: {varname: obj.varname, type: 'obj',
+                           pfdata: this_pf.attributes.objdata},
                  }));
         });
     });
@@ -183,6 +187,15 @@
 return gridViewerHandler;
 }
 
+function getGridDataViewerHandler(node){
+function gridDataViewerHandler(item, pressed){
+    yt_rpc.ExtDirectREPL.create_grid_dataview(
+        {pfname:node.attributes.objdata.varname},
+        handle_result);
+}
+return gridDataViewerHandler;
+}
+
 function getStreamlineViewerHandler(node){
 function streamlineViewerHandler(item, pressed){
     yt_rpc.ExtDirectREPL.create_streamline_viewer(
@@ -302,6 +315,90 @@
         {code: fcall}, cell_finished);
 }
 
+function getPhasePlotHandler(node){
+function phasePlotHandler(item,pressed){
+    var win = new Ext.Window({
+        layout:'fit',
+        width:370,
+        height:220,
+        modal:true,
+        resizable:false,
+        draggable:false,
+        border:false,
+        title:'Phase Plot Details for ' + node,
+        items: [{
+            xtype: 'form', // FormPanel
+            labelWidth:80,
+            frame:true,
+            items: [ {
+                xtype:'combo',
+                fieldLabel: 'X Field',
+                id: 'x_field',
+                store:node.attributes.objdata.pfdata.field_list,
+                width: 230,
+                allowBlank:false,
+                triggerAction: 'all',
+                value: 'Density'
+            },{
+                xtype:'combo',
+                fieldLabel: 'Y Field',
+                id: 'y_field',
+                store:node.attributes.objdata.pfdata.field_list,
+                width: 230,
+                allowBlank:false,
+                triggerAction: 'all',
+                value: 'Temperature'
+            },{
+                xtype:'combo',
+                fieldLabel: 'Z Field',
+                id: 'z_field',
+                store:node.attributes.objdata.pfdata.field_list,
+                width: 230,
+                allowBlank:false,
+                triggerAction: 'all',
+                value: 'CellMassMsun'
+            },{
+                xtype:'combo',
+                fieldLabel: 'Weight Field',
+                id: 'weight',
+                store:['None'].concat(node.attributes.objdata.pfdata.field_list),
+                width: 230,
+                allowBlank:false,
+                triggerAction: 'all',
+                value: 'None'
+            }],
+            buttons: [
+                {
+                    text: 'Calculate',
+                    handler: function(b, e){
+                        var x_field = Ext.get("x_field").getValue();
+                        var y_field = Ext.get("y_field").getValue();
+                        var z_field = Ext.get("z_field").getValue();
+                        var weight = Ext.get("weight").getValue();
+                        yt_rpc.ExtDirectREPL.create_phase({
+                                objname: node.attributes.objdata.varname,
+                                /* Mirror image varnames ... */
+                                field_x: x_field,
+                                field_y: y_field,
+                                field_z: z_field,
+                                weight: weight,
+                                },
+                              handle_result);
+                        disable_input();
+                        win.close();
+                    }
+                },{
+                    text: 'Cancel',
+                    handler: function(b, e){win.close()}
+                }
+            ]
+        }]
+    });
+    win.show(this);
+}
+return phasePlotHandler;
+}
+
 function getProjectionHandler(node){
 function projectionHandler(item,pressed){
     var win = new Ext.Window({
@@ -379,3 +476,111 @@
 }
 return projectionHandler;
 }
+
+function getSphereCreator(node){
+function sphereCreator(item,pressed){
+    var win = new Ext.Window({
+        layout:'fit',
+        width:320,
+        height:250,
+        modal:true,
+        resizable:false,
+        draggable:false,
+        border:false,
+        title:'Sphere Creator ' + node,
+        items: [{
+            xtype: 'form', // FormPanel
+            labelWidth:80,
+            frame:true,
+            items: [{
+                xtype:'textfield',
+                fieldLabel: 'Center X',
+                id: 'slice_x_center',
+                value: '0.5',
+                width: 90,
+                allowBlank:false,
+            },{
+                xtype:'textfield',
+                fieldLabel: 'Center Y',
+                id: 'slice_y_center',
+                value: '0.5',
+                width: 90,
+                allowBlank:false,
+            },{
+                xtype:'textfield',
+                fieldLabel: 'Center Z',
+                id: 'slice_z_center',
+                value: '0.5',
+                width: 90,
+                allowBlank:false,
+            },{
+                xtype:'textfield',
+                fieldLabel: 'Radius',
+                id: 'radius_value',
+                value: '0.5',
+                width: 90,
+                allowBlank:false,
+            },{
+                xtype:'combo',
+                fieldLabel: 'Unit',
+                id: 'radius_unit',
+                store:['unitary', '1', 'mpc', 'kpc', 'pc', 'au', 'rsun', 'cm'],
+                width: 90,
+                allowBlank:false,
+                value: 'Unitary',
+                triggerAction: 'all',
+            },{
+                xtype:'checkbox',
+                fieldLabel: 'Center on Max',
+                id: 'max_dens',
+                width: 90,
+                allowBlank:false,
+                handler: function(checkbox, checked) {
+                    if (checked == true) {
+                        this.ownerCt.get("slice_x_center").disable();
+                        this.ownerCt.get("slice_y_center").disable();
+                        this.ownerCt.get("slice_z_center").disable();
+                    } else {
+                        this.ownerCt.get("slice_x_center").enable();
+                        this.ownerCt.get("slice_y_center").enable();
+                        this.ownerCt.get("slice_z_center").enable();
+                    }
+                }
+            }],
+            buttons: [
+                {
+                    text: 'Slice',
+                    handler: function(b, e){
+                        var center = [Ext.get("slice_x_center").getValue(),
+                                      Ext.get("slice_y_center").getValue(),
+                                      Ext.get("slice_z_center").getValue()];
+                        var onmax = Ext.get("max_dens").getValue();
+                        var radius = [Ext.get("radius_value").getValue(),
+                                      Ext.get("radius_unit").getValue()]
+                        objargs = {radius: radius}
+                        if (onmax == true) {
+                            objargs['center'] = 'max';
+                        } else {
+                            objargs['center'] = center;
+                        }
+                        yt_rpc.ExtDirectREPL.object_creator({
+                            pfname:node.attributes.objdata.varname,
+                            objtype:'sphere', objargs:objargs},
+                          handle_result);
+                        disable_input();
+                        win.close();
+                    }
+                },{
+                    text: 'Cancel',
+                    handler: function(b, e){
+                        win.close();
+
+                    }
+                }
+            ]
+        }]
+    });
+    win.show(this);
+}
+return sphereCreator;
+}


--- a/yt/gui/reason/html/js/menu_items.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/menu_items.js	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 Author: Britton Smith <brittonsmith at gmail.com>
 Affiliation: MSU
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/gui/reason/html/js/reason.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/reason.js	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 Author: Britton Smith <brittonsmith at gmail.com>
 Affiliation: MSU
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
@@ -42,6 +42,11 @@
 var cell_count = 0;
 
 var handle_result = function(f, a) {
+    if(a.status == false){
+        Ext.Msg.alert("Error", "Something has gone wrong.");
+        examine = {f: f, a: a};
+        return;
+    }
     cell_finished(a.result);
 }
 
@@ -138,24 +143,41 @@
         },
         contextmenu: {
             fn: function(node, event){
-                if (node.attributes.objdata.type == 'obj') return;
-                var rightClickMenu = new Ext.menu.Menu({
-                    items: [
-                        {
-                            text: 'View Grids',
-                            handler: getGridViewerHandler(node),
-                        }, {
-                            text: 'Open slice',
-                            handler: getSliceHandler(node),
-                        }, {
-                            text: 'Open projection',
-                            handler: getProjectionHandler(node),
-                        }, {
-                            text: 'View Streamlines',
-                            handler: getStreamlineViewerHandler(node),
-                        }
-                    ]
-                });
+                var rightclickMenu;
+                if (node.attributes.objdata.type == 'obj') {
+                  rightClickMenu = new Ext.menu.Menu({
+                      items: [
+                          {
+                              text: 'Phase Plot',
+                              handler: getPhasePlotHandler(node),
+                          }, 
+                      ]
+                  });
+                } else if (node.attributes.objdata.type == 'pf') {
+                  rightClickMenu = new Ext.menu.Menu({
+                      items: [
+                          {
+                              text: 'View Grids',
+                              handler: getGridViewerHandler(node),
+                          }, {
+                              text: 'View Grid Data',
+                              handler: getGridDataViewerHandler(node),
+                          }, {
+                              text: 'Open slice',
+                              handler: getSliceHandler(node),
+                          }, {
+                              text: 'Open projection',
+                              handler: getProjectionHandler(node),
+                          /*}, {
+                              text: 'Create Sphere',
+                              handler: getSphereCreator(node), */
+                          }, {
+                              text: 'View Streamlines',
+                              handler: getStreamlineViewerHandler(node),
+                          }
+                      ]
+                  });
+                }
                 rightClickMenu.showAt(event.xy);
             }
         }


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/gui/reason/html/js/widget_griddata.js	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,146 @@
+/**********************************************************************
+The Plot Window Widget
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: Columbia University
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+// shim layer with setTimeout fallback
+var WidgetGridDataViewer = function(python_varname, widget_data) {
+    this.id = python_varname;
+    this.widget_data = widget_data;
+    store = new Ext.data.ArrayStore({
+        fields: [
+           {name: 'grid_id', type:'int'},
+           {name: 'level', type:'int'},
+           {name: 'left_edge_x', type: 'float'},
+           {name: 'left_edge_y', type: 'float'},
+           {name: 'left_edge_z', type: 'float'},
+           {name: 'right_edge_x', type: 'float'},
+           {name: 'right_edge_y', type: 'float'},
+           {name: 'right_edge_z', type: 'float'},
+           {name: 'dim_x', type: 'int'},
+           {name: 'dim_y', type: 'int'},
+           {name: 'dim_z', type: 'int'},
+           {name: 'cells', type: 'int'},
+        ]
+    });
+    store.loadData(widget_data['gridvals']);
+    examine = widget_data;
+
+    viewport.get("center-panel").add(
+        {
+            xtype: 'panel',
+            id: "gg_" + python_varname,
+            title: "Grid Data Viewer",
+            iconCls: 'graph',
+            autoScroll: true,
+            layout:'vbox',
+            layoutConfig: {align: 'stretch', pack: 'start'},
+            closable: true,
+            items: [ {
+                       xtype: 'grid',
+                       store: store,
+                       columns: [
+                            {
+                                id: 'grid_id',
+                                header: 'Grid ID',
+                                width: 100,
+                                dataIndex: 'grid_id',
+                                sortable: true,
+                            }, {
+                                id: 'left_edge_x',
+                                header: 'Left Edge x',
+                                width: 100,
+                                dataIndex: 'left_edge_x',
+                                sortable: true,
+                            }, {
+                                id: 'left_edge_y',
+                                header: 'Left Edge y',
+                                width: 100,
+                                dataIndex: 'left_edge_y',
+                                sortable: true,
+                            }, {
+                                id: 'left_edge_z',
+                                header: 'Left Edge z',
+                                width: 100,
+                                dataIndex: 'left_edge_z',
+                                sortable: true,
+                            }, {
+                                id: 'right_edge_x',
+                                header: 'Right Edge x',
+                                width: 100,
+                                dataIndex: 'right_edge_x',
+                                sortable: true,
+                            }, {
+                                id: 'right_edge_y',
+                                header: 'Right Edge y',
+                                width: 100,
+                                dataIndex: 'right_edge_y',
+                                sortable: true,
+                            }, {
+                                id: 'right_edge_z',
+                                header: 'Right Edge z',
+                                width: 100,
+                                dataIndex: 'right_edge_z',
+                                sortable: true,
+                            }, {
+                                id: 'dim_x',
+                                header: 'DimX',
+                                width: 100,
+                                dataIndex: 'dim_x',
+                                sortable: true,
+                            }, {
+                                id: 'dim_y',
+                                header: 'DimY',
+                                width: 100,
+                                dataIndex: 'dim_y',
+                                sortable: true,
+                            }, {
+                                id: 'dim_z',
+                                header: 'DimZ',
+                                width: 100,
+                                dataIndex: 'dim_z',
+                                sortable: true,
+                            }, {
+                                id: 'cells',
+                                header: 'Cells',
+                                width: 100,
+                                dataIndex: 'cells',
+                                sortable: true,
+                            },
+                       ],
+                      flex: 1,
+                      }
+                   ],
+
+        }
+    );
+
+    viewport.get("center-panel").activate("gg_" + this.id);
+    viewport.doLayout();
+    this.panel = viewport.get("center-panel").get("gg_" + python_varname);
+    this.panel.doLayout();
+
+    this.accept_results = function(payload) { }
+}
+
+widget_types['grid_data'] = WidgetGridDataViewer;


--- a/yt/gui/reason/html/js/widget_gridviewer.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/widget_gridviewer.js	Mon May 09 15:14:08 2011 -0700
@@ -4,7 +4,7 @@
 Author: Samuel Skillman <samskillman at gmail.com>
 Affiliation: University of Colorado at Boulder
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/gui/reason/html/js/widget_phaseplot.js	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,239 @@
+/**********************************************************************
+The Plot Window Widget
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: Columbia University
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+
+
+var WidgetPhasePlot = function(python_varname, widget_data) {
+    this.id = python_varname;
+    this.widget_data = widget_data;
+
+    viewport.get("center-panel").add(
+        {
+            xtype: 'panel',
+            id: "pp_" + this.id,
+            title: widget_data['title'],
+            iconCls: 'graph',
+            autoScroll: true,
+            layout:'absolute',
+            closable: true,
+            items: [ 
+                {
+                    xtype: 'panel',
+                    id: 'y_ticks_' + python_varname,
+                    layout: 'absolute',
+                    y: 10,
+                    x: 100,
+                    width: 40,
+                    height: 400,
+                    items : [],
+                    border: false,
+                }, {
+                    xtype: 'panel',
+                    id: 'x_ticks_' + python_varname,
+                    layout: 'absolute',
+                    y: 410,
+                    x: 140,
+                    width: 400,
+                    height: 40,
+                    items : [],
+                    border: false,
+                }, {
+                    xtype:'panel',
+                    id: 'image_panel_' + this.id,
+                    autoEl: {
+                        tag: 'img',
+                        id: "img_" + this.id,
+                        width: 400,
+                        height: 400,
+                        style: 'border: 1px solid #000000',
+                    },
+                    x: 138,
+                    y: 8,
+                    width: 400,
+                    height: 400,
+                }, {
+                    xtype:'panel',
+                    id: 'colorbar_' + python_varname,
+                    autoEl: {
+                        tag: 'img',
+                        id: "cb_" + python_varname,
+                        src: "data:image/png;base64," +
+                             widget_data['colorbar'],
+                        width: 28,
+                        height: 398,
+                        style: 'border: 1px solid #000000;',
+                    },
+                    x: 560,
+                    y: 10,
+                    width: 30,
+                    height: 400,
+                }, {
+                    xtype: 'panel',
+                    id: 'ticks_' + python_varname,
+                    layout: 'absolute',
+                    y: 10,
+                    x: 590,
+                    width: 40,
+                    height: 400,
+                    items : [],
+                    border: false,
+                },{
+                    xtype: 'button',
+                    text: 'Upload Image',
+                    x: 10,
+                    y: 285,
+                    width: 80,
+                    tooltip: "Upload the current image to " +
+                             "<a href='http://imgur.com'>imgur.com</a>",
+                    handler: function(b,e) {
+                        img_data = image_dom.src;
+                        yt_rpc.ExtDirectREPL.upload_image(
+                            {image_data:img_data,
+                             caption:metadata_string},
+                        function(rv) {
+                            var alert_text;
+                            if(rv['uploaded'] == false) {
+                                alert_text = "Failure uploading image!";
+                            } else {
+                                alert_text = "Uploaded to " +
+                                        rv['upload']['links']['imgur_page'];
+                            }
+                            Ext.Msg.alert('imgur.com', alert_text);
+                            var record = new logging_store.recordType(
+                                {record: alert_text });
+                            logging_store.add(record, number_log_records++);
+                        }); 
+                    }
+                },{
+                    xtype: 'panel',
+                    layout: 'vbox',
+                    id: 'rhs_panel_' + python_varname,
+                    width: 300,
+                    height: 460,
+                    x: 640, y: 10,
+                    layoutConfig: {
+                        align: 'stretch',
+                        pack: 'start',
+                    },
+                    items: [
+                        {
+                          xtype: 'panel',
+                          title: 'Plot MetaData',
+                          id: 'metadata_' + python_varname,
+                          style: {fontFamily: '"Inconsolata", monospace'},
+                          html: 'Welcome to the Plot Window.',
+                          height: 200,
+                        }, {
+                          xtype: 'panel',
+                          title: 'Plot Editor',
+                          id: 'plot_edit',
+                          flex: 1,
+                        }]
+                }
+            ]
+        }
+    );
+
+    viewport.get("center-panel").activate("pp_" + this.id);
+    viewport.get("center-panel").doLayout();
+    viewport.doLayout();
+    this.panel = viewport.get("center-panel").get("pp_" + python_varname);
+    this.panel.doLayout();
+    this.panel.show();
+    this.image_panel = this.panel.get("image_panel_"+python_varname);
+    this.ticks = this.panel.get("ticks_"+python_varname);
+    var x_ticks = this.panel.get("x_ticks_"+python_varname);
+    var y_ticks = this.panel.get("y_ticks_"+python_varname);
+    var ticks = this.ticks;
+    this.metadata_panel = this.panel.get("rhs_panel_" + python_varname).get("metadata_" + python_varname);
+    var image_dom = this.image_panel.el.dom;
+    var control_panel = this.panel;
+    var metadata_string;
+    var colorbar = this.panel.get("colorbar_"+python_varname);
+
+    this.accept_results = function(payload) {
+        this.image_panel.el.dom.src = "data:image/png;base64," + payload['image_data'];
+        examine = this.metadata_panel;
+        this.metadata_panel.update(payload['metadata_string']);
+        metadata_string = payload['metadata_string'];
+        ticks.removeAll();
+        colorbar.el.dom.src = "data:image/png;base64," +
+                              payload['cbar']['cmap_image'];
+        Ext.each(payload['yax']['ticks'], function(tick, index) {
+            examine = tick;
+            y_ticks.add({xtype:'panel',
+                       width: 20, height:15,
+                       border: false,
+                       style: 'font-family: "Inconsolata", monospace;' +
+                              'font-size: 12px; text-align: right;' +
+                              'padding-right: 5px;',
+                       html: ' ' + tick[2] + ' ',
+                       x:0, y: tick[0]-6});
+            y_ticks.add({xtype:'panel',
+                       width: 20, height:1,
+                       style: 'background-color: #000000;',
+                       html:' ',
+                       x:20, y: tick[0]});
+        });
+        y_ticks.doLayout();
+        Ext.each(payload['xax']['ticks'], function(tick, index) {
+            examine = tick;
+            x_ticks.add({xtype:'panel',
+                       width: 1, height:20,
+                       style: 'background-color: #000000;',
+                       html:' ',
+                       x:(400 - tick[0]) + 10, y: 0});
+            x_ticks.add({xtype:'panel',
+                       width: 20, height:20,
+                       border: false,
+                       style: 'font-family: "Inconsolata", monospace;' +
+                              'font-size: 12px; text-align: center;',
+                       html: ' ' + tick[2] + ' ',
+                       x: (400 - tick[0]), y: 20});
+        });
+        x_ticks.doLayout();
+        Ext.each(payload['cbar']['ticks'], function(tick, index) {
+            ticks.add({xtype:'panel',
+                       width: 10, height:1,
+                       style: 'background-color: #000000;',
+                       html:' ',
+                       x:0, y: tick[0]});
+            ticks.add({xtype:'panel',
+                       width: 30, height:15,
+                       border: false,
+                       style: 'font-family: "Inconsolata", monospace;' +
+                              'font-size: 12px;',
+                       html: ' ' + tick[2] + ' ',
+                       x:18, y: tick[0]-6});
+        });
+        ticks.doLayout();
+        x_ticks.doLayout();
+    }
+    yt_rpc.ExtDirectREPL.execute(
+        {code:python_varname + '._setup_plot()', hide:true},
+        cell_finished);
+}
+
+widget_types['phase_plot'] = WidgetPhasePlot;


--- a/yt/gui/reason/html/js/widget_plotwindow.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/widget_plotwindow.js	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 Author: Britton Smith <brittonsmith at gmail.com>
 Affiliation: MSU
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
@@ -94,6 +94,32 @@
                             });
                         }
                     }
+                }, {
+                    xtype:'panel',
+                    id: 'colorbar_' + python_varname,
+                    autoEl: {
+                        tag: 'img',
+                        id: "cb_" + python_varname,
+                        src: "data:image/png;base64," +
+                             widget_data['colorbar'],
+                        width: 28,
+                        height: 398,
+                        style: 'border: 1px solid #000000;',
+                    },
+                    x: 510,
+                    y: 10,
+                    width: 30,
+                    height: 400,
+                }, {
+                    xtype: 'panel',
+                    id: 'ticks_' + python_varname,
+                    layout: 'absolute',
+                    y: 0,
+                    x: 540,
+                    width: 100,
+                    height: 420,
+                    items : [],
+                    border: false,
                 }, {   xtype: 'multislider',
                     id: 'slider_' + python_varname,
                     minValue: 0,
@@ -308,9 +334,9 @@
                     xtype: 'panel',
                     layout: 'vbox',
                     id: 'rhs_panel_' + python_varname,
-                    width: 300,
+                    width: 250,
                     height: 460,
-                    x: 510, y: 10,
+                    x: 690, y: 10,
                     layoutConfig: {
                         align: 'stretch',
                         pack: 'start',
@@ -341,6 +367,8 @@
     this.panel.doLayout();
     this.panel.show();
     this.image_panel = this.panel.get("image_panel_"+python_varname);
+    this.ticks = this.panel.get("ticks_"+python_varname);
+    var ticks = this.ticks;
     this.metadata_panel = this.panel.get("rhs_panel_" + python_varname).get("metadata_" + python_varname);
     this.zoom_scroll = this.panel.get("slider_" + python_varname);
     var image_dom = this.image_panel.el.dom;
@@ -353,6 +381,25 @@
         examine = this.metadata_panel;
         this.metadata_panel.update(payload['metadata_string']);
         metadata_string = payload['metadata_string'];
+        ticks.removeAll();
+        Ext.each(payload['ticks'], function(tick, index) {
+            console.log(tick);
+            ticks.add({xtype:'panel',
+                       width: 10, height:1,
+                       style: 'background-color: #000000;',
+                       html:' ',
+                       x:0, y: 10 + tick[0]});
+            ticks.add({xtype:'panel',
+                       width: 90, height:15,
+                       border: false,
+                       style: 'font-family: "Inconsolata", monospace;' +
+                              'font-size: 12px;',
+                       html: '' + tick[2] + '',
+                       x:12, y: 4 + tick[0]});
+            examine = tick;
+        });
+        examine = payload['ticks'];
+        ticks.doLayout();
     }
 
     yt_rpc.ExtDirectREPL.execute(


--- a/yt/gui/reason/html/js/widget_progressbar.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/widget_progressbar.js	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 The Plot Window Widget
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/gui/reason/html/js/widget_streamlineviewer.js	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/html/js/widget_streamlineviewer.js	Mon May 09 15:14:08 2011 -0700
@@ -4,7 +4,7 @@
 Author: Samuel Skillman <samskillman at gmail.com>
 Affiliation: University of Colorado at Boulder
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/gui/reason/http_repl.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/reason/http_repl.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 commands through HTTP
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/gui/traited_explorer/tvtk_interface.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/gui/traited_explorer/tvtk_interface.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/mods.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/mods.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -56,6 +56,9 @@
     EnzoStaticOutput, EnzoStaticOutputInMemory, EnzoFieldInfo, \
     add_enzo_field, add_enzo_1d_field, add_enzo_2d_field
 
+from yt.frontends.castro.api import \
+    CastroStaticOutput, CastroFieldInfo, add_castro_field
+
 from yt.frontends.orion.api import \
     OrionStaticOutput, OrionFieldInfo, add_orion_field
 
@@ -92,7 +95,8 @@
 from yt.visualization.api import \
     PlotCollection, PlotCollectionInteractive, \
     get_multi_plot, FixedResolutionBuffer, ObliqueFixedResolutionBuffer, \
-    callback_registry, write_bitmap, write_image, annotate_image
+    callback_registry, write_bitmap, write_image, annotate_image, \
+    apply_colormap
 
 from yt.visualization.volume_rendering.api import \
     ColorTransferFunction, PlanckTransferFunction, ProjectionTransferFunction, \


--- a/yt/utilities/_amr_utils/ContourFinding.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/ContourFinding.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/_amr_utils/Octree.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/Octree.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/_amr_utils/QuadTree.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/QuadTree.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/_amr_utils/fortran_reader.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/fortran_reader.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -300,3 +300,22 @@
                     filled[offi, offj, offk] = 1
                     to_fill += 1
     return to_fill
+
+ at cython.cdivision(True)
+ at cython.boundscheck(False)
+ at cython.wraparound(False)
+def read_castro_particles(char *fn, int offset, int fieldindex, int nfields,
+                          np.ndarray[np.float64_t, ndim=1] tofill):
+    cdef int nparticles = tofill.shape[0]
+    cdef int i
+    cdef startskip = fieldindex*8
+    cdef endskip = (nfields - 1 - fieldindex)*8
+    cdef np.float64_t temp
+    cdef FILE *f = fopen(fn, 'r')
+    fseek(f, offset + 5*nparticles*4, 0) # 4 bytes
+    for i in range(nparticles):
+        fseek(f, startskip, SEEK_CUR)
+        fread(&temp, 8, 1, f)
+        tofill[i] = temp
+        fseek(f, endskip, SEEK_CUR)
+    fclose(f)


--- a/yt/utilities/_amr_utils/freetype_includes.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/freetype_includes.h	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/utilities/_amr_utils/freetype_writer.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/freetype_writer.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/_amr_utils/healpix_interface.pxd	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/healpix_interface.pxd	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 A light interface to a few HEALPix routines
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/_amr_utils/kdtree.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/kdtree.c	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /*
 This file is part of ``kdtree'', a library for working with kd-trees.
-Copyright (C) 2007-2009 John Tsiombikas <nuclear at siggraph.org>
+Copyright (C) 2007-2011 John Tsiombikas <nuclear at siggraph.org>
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:


--- a/yt/utilities/_amr_utils/kdtree.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/kdtree.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /*
 This file is part of ``kdtree'', a library for working with kd-trees.
-Copyright (C) 2007-2009 John Tsiombikas <nuclear at siggraph.org>
+Copyright (C) 2007-2011 John Tsiombikas <nuclear at siggraph.org>
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:


--- a/yt/utilities/_amr_utils/kdtree_utils.pxd	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/kdtree_utils.pxd	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 A light interface to kdtree, from http://code.google.com/p/kdtree/
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/_amr_utils/png_writer.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_amr_utils/png_writer.pyx	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/_libconfig/libconfig.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/libconfig.c	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/libconfig.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/libconfig.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/parsectx.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/parsectx.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/scanctx.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/scanctx.c	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/scanctx.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/scanctx.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/scanner.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/scanner.c	Mon May 09 15:14:08 2011 -0700
@@ -542,7 +542,7 @@
 /* -*- mode: C -*- */
 /* --------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/scanner.l	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/scanner.l	Mon May 09 15:14:08 2011 -0700
@@ -1,7 +1,7 @@
 /* -*- mode: C -*- */
 /* --------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/strbuf.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/strbuf.c	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/strbuf.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/strbuf.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/_libconfig/wincompat.h	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/_libconfig/wincompat.h	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
    libconfig - A library for processing structured configuration files
-   Copyright (C) 2005-2010  Mark A Lindner
+   Copyright (C) 2005-2011  Mark A Lindner
 
    This file is part of libconfig.
 


--- a/yt/utilities/amr_kdtree/amr_kdtree.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Samuel Skillman.  All Rights Reserved.
+  Copyright (C) 2010-2011 Samuel Skillman.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/amr_kdtree/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/amr_kdtree/api.py	Mon May 09 15:14:08 2011 -0700
@@ -8,7 +8,7 @@
 
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Samuel Skillman.  All Rights Reserved.
+  Copyright (C) 2010-2011 Samuel Skillman.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/answer_testing/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/answer_testing/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/answer_testing/default_tests.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/default_tests.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Default tests
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/answer_testing/hydro_tests.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/hydro_tests.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Hydro tests
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/answer_testing/output_tests.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/output_tests.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Base classes for answer testing
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/answer_testing/runner.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/answer_testing/runner.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Runner mechanism for answer testing
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/command_line.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/command_line.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -939,6 +939,13 @@
             sock.bind(('', 0))
             opts.port = sock.getsockname()[-1]
             del sock
+        elif opts.port == '-1':
+            port = raw_input("Desired yt port? ")
+            try:
+                opts.port = int(port)
+            except ValueError:
+                print "Please try a number next time."
+                return 1
         base_extjs_path = os.path.join(os.environ["YT_DEST"], "src")
         if not os.path.isfile(os.path.join(base_extjs_path, "ext-resources", "ext-all.js")):
             print


--- a/yt/utilities/cosmology.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/cosmology.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: CASA/University of CO, Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Britton Smith.  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/data_point_utilities.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/data_point_utilities.c	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/utilities/definitions.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/definitions.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 
 @todo: Move into yt.Defs, along with enki.EnkiDefs
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/hdf5_light_reader.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/hdf5_light_reader.c	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/utilities/io_handler.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/io_handler.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/libconfig_wrapper.pyx	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/libconfig_wrapper.pyx	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 minimum of the API.
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia University
+Affiliation: Columbia University University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/linear_interpolators.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/linear_interpolators.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/logger.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/logger.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/math_utils.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/math_utils.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/parallel_tools/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/parallel_tools/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/parallel_tools/distributed_object_collection.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/parallel_tools/distributed_object_collection.py	Mon May 09 15:14:08 2011 -0700
@@ -6,7 +6,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/parallel_tools/task_queue.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/parallel_tools/task_queue.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 A task queue for distributing work to worker agents
 
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/utilities/parameter_file_storage.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/parameter_file_storage.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/utilities/pasteboard.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/utilities/pasteboard.py	Mon May 09 15:14:08 2011 -0700
@@ -1,6 +1,6 @@
 """
 Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: NSF / Columbia
+Affiliation: Columbia University
 Homepage: http://yt.enzotools.org/
 License:
   Copyright (C) 2011 Matthew Turk.  All Rights Reserved.


--- a/yt/visualization/_MPL.c	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/_MPL.c	Mon May 09 15:14:08 2011 -0700
@@ -1,5 +1,5 @@
 /************************************************************************
-* Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+* Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 *
 * This file is part of yt.
 *


--- a/yt/visualization/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -10,7 +10,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -47,7 +47,8 @@
     write_image, \
     map_to_colors, \
     splat_points, \
-    annotate_image
+    annotate_image, \
+    apply_colormap
 
 from plot_modifications import \
     PlotCallback, \


--- a/yt/visualization/color_maps.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/color_maps.py	Mon May 09 15:14:08 2011 -0700
@@ -4,7 +4,7 @@
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation: KIPAC/SLAC/Stanford
 License:
-  Copyright (C) 2008-2009 Britton Smith, Matthew Turk  All Rights Reserved.
+  Copyright (C) 2008-2011 Britton Smith, Matthew Turk  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/easy_plots.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/easy_plots.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UCSD
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/eps_writer.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/eps_writer.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Requirements: PyX
 
 License:
-  Copyright (C) 2010 John Wise.  All Rights Reserved.
+  Copyright (C) 2010-2011 John Wise.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/fixed_resolution.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/fixed_resolution.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/image_panner/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/image_panner/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/image_panner/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/image_panner/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/image_panner/pan_and_scan_widget.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/image_panner/pan_and_scan_widget.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/image_panner/vm_panner.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/image_panner/vm_panner.py	Mon May 09 15:14:08 2011 -0700
@@ -3,7 +3,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/image_writer.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/image_writer.py	Mon May 09 15:14:08 2011 -0700
@@ -2,7 +2,7 @@
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation:  UCSD
 License:
-  Copyright (C) 2010 Matthew Turk  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk  All Rights Reserved.
 
   This file is part of yt.
 
@@ -209,6 +209,8 @@
         mi = na.nanmin(image[~na.isinf(image)])
         ma = na.nanmax(image[~na.isinf(image)])
         color_bounds = mi, ma
+    else:
+        color_bounds = [func(c) for c in color_bounds]
     image = (image - color_bounds[0])/(color_bounds[1] - color_bounds[0])
     to_plot = map_to_colors(image, cmap_name)
     to_plot = na.clip(to_plot, 0, 255)


--- a/yt/visualization/plot_collection.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/plot_collection.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/plot_modifications.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/plot_modifications.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: UC San Diego
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2008-2009 Matthew Turk, JS Oishi, Stephen Skory.  All Rights Reserved.
+  Copyright (C) 2008-2011 Matthew Turk, JS Oishi, Stephen Skory.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/plot_types.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/plot_types.py	Mon May 09 15:14:08 2011 -0700
@@ -7,7 +7,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2007-2009 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/plot_window.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/plot_window.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 J. S. Oishi.  All Rights Reserved.
+  Copyright (C) 2010-2011 J. S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 
@@ -22,20 +22,24 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
+import base64
+import tempfile
+import matplotlib.pyplot
+from functools import wraps
 
-import tempfile
 import numpy as na
-import color_maps
-from image_writer import \
+from .image_writer import \
     write_image, apply_colormap
+from .fixed_resolution import \
+    FixedResolutionBuffer
+from .plot_modifications import get_smallest_appropriate_unit
+from .tick_locators import LogLocator, LinearLocator
+
 from yt.funcs import *
 from yt.utilities.amr_utils import write_png_to_file
-from fixed_resolution import \
-    FixedResolutionBuffer
-import matplotlib.pyplot
-from .plot_modifications import get_smallest_appropriate_unit
 
 def invalidate_data(f):
+    @wraps(f)
     def newfunc(*args, **kwargs):
         f(*args, **kwargs)
         args[0]._data_valid = False
@@ -43,10 +47,10 @@
         args[0]._recreate_frb()
         if args[0]._initfinished:
             args[0]._setup_plots()
-
     return newfunc
 
 def invalidate_plot(f):
+    @wraps(f)
     def newfunc(*args, **kwargs):
         args[0]._plot_valid = False
         args[0]._setup_plots()
@@ -316,9 +320,10 @@
     _ext_widget_id = None
     _current_field = None
     _widget_name = "plot_window"
+    cmap = 'algae'
+
     def _setup_plots(self):
         from yt.gui.reason.bottle_mods import PayloadHandler
-        import base64
         ph = PayloadHandler()
         if self._current_field is not None \
            and self._ext_widget_id is not None:
@@ -340,13 +345,52 @@
             x_width = self.xlim[1] - self.xlim[0]
             zoom_fac = na.log10(x_width*self._frb.pf['unitary'])/na.log10(min_zoom)
             zoom_fac = 100.0*max(0.0, zoom_fac)
+            ticks = self.get_ticks(self._frb[field].min(),
+                                   self._frb[field].max(), 
+                                   take_log = self._frb.pf.field_info[field].take_log)
             payload = {'type':'png_string',
                        'image_data':img_data,
                        'metadata_string': self.get_metadata(field),
-                       'zoom': zoom_fac}
+                       'zoom': zoom_fac,
+                       'ticks': ticks}
             payload.update(addl_keys)
             ph.add_payload(payload)
 
+    def get_ticks(self, mi, ma, height = 400, take_log = False):
+        # This will eventually change to work with non-logged fields
+        ticks = []
+        if take_log:
+            ll = LogLocator() 
+            tick_locs = ll(mi, ma)
+            mi = na.log10(mi)
+            ma = na.log10(ma)
+            for v1,v2 in zip(tick_locs, na.log10(tick_locs)):
+                if v2 < mi or v2 > ma: continue
+                p = height - height * (v2 - mi)/(ma - mi)
+                ticks.append((p,v1,v2))
+                #print v1, v2, mi, ma, height, p
+        else:
+            ll = LinearLocator()
+            tick_locs = ll(mi, ma)
+            for v in tick_locs:
+                p = height - height * (v - mi)/(ma-mi)
+                ticks.append((p,v,"%0.3e" % (v)))
+
+        return ticks
+
+    def _get_cbar_image(self, height = 400, width = 40):
+        # Right now there's just the single 'cmap', but that will eventually
+        # change.  I think?
+        vals = na.mgrid[1:0:height * 1j] * na.ones(width)[:,None]
+        vals = vals.transpose()
+        to_plot = apply_colormap(vals)
+        tf = tempfile.TemporaryFile()
+        write_png_to_file(to_plot, tf)
+        tf.seek(0)
+        img_data = base64.b64encode(tf.read())
+        tf.close()
+        return img_data
+
     # This calls an invalidation routine from within
     def scroll_zoom(self, value):
         # We accept value from 0..100, and assume it has been set from the


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/visualization/profile_plotter.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,344 @@
+"""
+This is a simple mechanism for interfacing with Profile and Phase plots
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: Columbia University
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+import tempfile
+import base64
+import types
+
+from functools import wraps
+import numpy as na
+
+from .image_writer import \
+    write_image, apply_colormap
+from yt.utilities.amr_utils import \
+    write_png_to_file
+from yt.data_objects.profiles import \
+    BinnedProfile1D, \
+    BinnedProfile2D
+from .plot_types import ProfilePlot, PhasePlot
+from .tick_locators import LogLocator
+
+def invalidate_plot(f):
+    @wraps(f)
+    def newfunc(*args, **kwargs):
+        args[0]._plot_valid = False
+        args[0]._setup_plot()
+        return f(*args, **kwargs)
+    return newfunc
+
+class AxisSpec(object):
+    title = None
+    bounds = None
+    scale = None
+    ticks = None
+
+    def calculate_ticks(self):
+        if self.scale == 'log':
+            locator = LogLocator()
+        else:
+            raise NotImplementedError
+        self.ticks = locator(*self.bounds)
+
+class ColorbarSpec(AxisSpec):
+    cmap = None
+    display = True
+
+class ImagePlotContainer(object):
+    x_spec = None
+    y_spec = None
+    image = None
+    cbar = None
+
+    def to_mpl(self, place = None):
+        import _mpl_imports as mpl
+        if isinstance(place, mpl.matplotlib.figure.Figure):
+            figure, place = place, None
+            place = None
+        else:
+            figure = mpl.matplotlib.figure.Figure((10,8))
+        if isinstance(place, mpl.matplotlib.axes.Axes):
+            axes, place = place, None
+        else:
+            axes = figure.add_subplot(1,1,1)
+        # We'll go with a mesh here, even if it's inappropriate
+        use_mesh = False
+        xmi, xma = self.x_spec.bounds
+        if self.x_spec.scale == 'log':
+            x_bins = na.logspace(na.log10(xmi), na.log10(xma),
+                                 self.image.shape[0]+1)
+            use_mesh = True
+        else:
+            x_bins = na.logspace(xmi, xma, self.image.shape[0]+1)
+
+        ymi, yma = self.y_spec.bounds
+        if self.y_spec.scale == 'log':
+            y_bins = na.logspace(na.log10(ymi), na.log10(yma),
+                                 self.image.shape[0]+1)
+            use_mesh = True
+        else:
+            y_bins = na.logspace(ymi, yma, self.image.shape[0]+1)
+
+        im = self.image
+        if self.cbar.scale == 'log':
+            norm = mpl.matplotlib.colors.LogNorm()
+        else:
+            norm = mpl.matplotlib.colors.Normalize()
+        if use_mesh:
+            pcm = axes.pcolormesh(x_bins, y_bins, self.image, norm=norm,
+                                  shading='flat', cmap = self.cbar.cmap,
+                                  rasterized=True)
+            if self.x_spec.scale == 'log': axes.set_xscale("log")
+            if self.y_spec.scale == 'log': axes.set_yscale("log")
+        else:
+            axes.imshow(self.image, origin='lower', interpolation='nearest',
+                        cmap = self.cbar.cmap, extent = [xmi,xma,ymi,yma],
+                        norm = norm)
+        if self.x_spec.title is not None:
+            axes.set_xlabel(self.x_spec.title)
+        if self.y_spec.title is not None:
+            axes.set_ylabel(self.y_spec.title)
+        if isinstance(place, types.StringTypes):
+            canvas = mpl.FigureCanvasAgg(figure)
+            canvas.print_figure(place)
+        return figure, axes
+
+class PhasePlotter(object):
+    scale = None
+    _current_field = None
+
+    def __init__(self, data_source, field_x, field_y, field_z,
+                 weight="CellMassMsun", accumulation=False,
+                 x_bins=128, x_log=True, x_bounds=None,
+                 y_bins=128, y_log=True, y_bounds=None,
+                 lazy_reader=True, fractional=False):
+        r"""From an existing object, create a 2D, binned profile.
+
+        This function will accept an existing `AMRData` source and from that,
+        it will generate a `Binned2DProfile`, based on the specified options.
+        This is useful if you have extracted a region, or if you wish to bin
+        some set of massages data -- or even if you wish to bin anything other
+        than a sphere.  The profile will be 2D, which means while it can have
+        an arbitrary number of fields, those fields will all be binned based on
+        two fields.
+
+        Parameters
+        ----------
+        data_source : `yt.data_objects.api.AMRData`
+            This is a data source respecting the `AMRData` protocol (i.e., it
+            has grids and so forth) that will be used as input to the profile
+            generation.
+        fields : list of strings
+            The first element of this list is the field by which we will bin
+            into the x-axis, the second is the field by which we will bin onto
+            the y-axis.  All subsequent fields will be binned and their
+            profiles added to the underlying `BinnedProfile2D`.
+        cmap : string, optional
+            An acceptable colormap.  See either raven.color_maps or
+            http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps .
+        weight : string, default "CellMassMsun"
+            The weighting field for an average.  This defaults to mass-weighted
+            averaging.
+        accumulation : list of booleans, optional
+            If true, from the low-value to the high-value the values in all
+            binned fields will be accumulated.  This is useful for instance
+            when adding an unweighted CellMassMsun to a radial plot, as it will
+            show mass interior to that radius.  The first value is for the
+            x-axis, the second value for the y-axis.  Note that accumulation
+            will only be along each row or column.
+        x_bins : int, optional
+            How many bins should there be in the x-axis variable?
+        x_log : boolean, optional
+            Should the bin edges be log-spaced?
+        x_bounds : tuple of floats, optional
+            If specified, the boundary values for the binning.  If unspecified,
+            the min/max from the data_source will be used.  (Non-zero min/max
+            in case of log-spacing.)
+        y_bins : int, optional
+            How many bins should there be in the y-axis variable?
+        y_log : boolean, optional
+            Should the bin edges be log-spaced?
+        y_bounds : tuple of floats, optional
+            If specified, the boundary values for the binning.  If unspecified,
+            the min/max from the data_source will be used.  (Non-zero min/max
+            in case of log-spacing.)
+        lazy_reader : boolean, optional
+            If this is false, all of the data will be read into memory before
+            any processing occurs.  It defaults to true, and grids are binned
+            on a one-by-one basis.  Note that parallel computation requires
+            this to be true.
+        fractional : boolean
+            If true, the plot will be normalized to the sum of all the binned
+            values.
+
+        Returns
+        -------
+        plot : `yt.visualization.plot_types.PlotTypes.PhasePlot`
+            The plot that has been added to the PlotCollection.
+
+        See Also
+        --------
+        yt.data_objects.profiles.BinnedProfile2D : This is the object that does the
+                                   transformation of raw data into a 1D
+                                   profile.
+        
+        Examples
+        --------
+        This will show the mass-distribution in the Density-Temperature plane.
+        
+        >>> pf = load("RD0005-mine/RedshiftOutput0005")
+        >>> reg = pf.h.region([0.1, 0.2, 0.3], [0.0, 0.1, 0.2],
+        ...                   [0.2, 0.3, 0.4])
+        >>> pc.add_phase_object(reg, ["Density", "Temperature", "CellMassMsun"],
+        ...                     weight = None)
+        """
+        if x_bounds is None:
+            x_min, x_max = data_source.quantities["Extrema"](
+                                    field_x, non_zero = x_log,
+                                    lazy_reader=lazy_reader)[0]
+        else:
+            x_min, x_max = x_bounds
+        if y_bounds is None:
+            y_min, y_max = data_source.quantities["Extrema"](
+                                    field_y, non_zero = y_log,
+                                    lazy_reader=lazy_reader)[0]
+        else:
+            y_min, y_max = y_bounds
+        profile = BinnedProfile2D(data_source,
+                                  x_bins, field_x, x_min, x_max, x_log,
+                                  y_bins, field_y, y_min, y_max, y_log,
+                                  lazy_reader)
+        # This is a fallback, in case we forget.
+        if field_z == "CellMassMsun": weight = None
+        profile.add_fields(field_z, weight=weight, accumulation=accumulation, fractional=fractional)
+        self._current_field = field_z
+        self.profile = profile
+        self.scale = {True:'log', False:'linear'}.get(
+                data_source.pf.field_info[field_z], "log")
+        self._setup_plot()
+
+    def _setup_plot(self):
+        xax = AxisSpec()
+        xax.title = self.profile.x_bin_field
+        xax.bounds = (self.profile._x_bins[0],
+                      self.profile._x_bins[-1])
+        xax.scale = {True: 'log', False: 'linear'}[self.profile._x_log]
+        xax.calculate_ticks()
+
+        yax = AxisSpec()
+        yax.title = self.profile.y_bin_field
+        yax.bounds = (self.profile._y_bins[0],
+                      self.profile._y_bins[-1])
+        yax.scale = {True: 'log', False: 'linear'}[self.profile._y_log]
+        yax.calculate_ticks()
+
+        cbar = ColorbarSpec()
+        cbar.title = self._current_field
+        if self.scale == 'log':
+            nz = (self.profile[self._current_field] > 0)
+            mi = self.profile[self._current_field][nz].min()
+        else:
+            mi = self.profile[self._current_field][nz].min()
+        ma = self.profile[self._current_field].max()
+        cbar.bounds = (mi, ma)
+        cbar.cmap = 'algae'
+        cbar.scale = self.scale
+        cbar.calculate_ticks()
+
+        self.plot = ImagePlotContainer()
+        self.plot.image = self.profile[self._current_field].transpose()
+        self.plot.x_spec = xax
+        self.plot.y_spec = yax
+        self.plot.cbar = cbar
+
+class PhasePlotterExtWidget(PhasePlotter):
+    _ext_widget_id = None
+    _widget_name = "phase_plot"
+
+    def _setup_plot(self):
+        if self._ext_widget_id is None: return
+        PhasePlotter._setup_plot(self)
+        # Now self.plot exists
+        from yt.gui.reason.bottle_mods import PayloadHandler
+        ph = PayloadHandler()
+        # We set up an x axis, y axis, colorbar, and image
+        xax = self._convert_axis(self.plot.x_spec)
+        yax = self._convert_axis(self.plot.y_spec)
+        cbar = self._convert_axis(self.plot.cbar)
+        cbar['cmap_image'] = self._get_cbar_image()
+        # This is a historical artifact
+        raw_data = self.plot.image[::-1,:]
+
+        if self.plot.cbar.scale == 'log':
+            func = na.log10
+        else:
+            func = lambda a: a
+        to_plot = apply_colormap(raw_data, self.plot.cbar.bounds,
+                                 self.plot.cbar.cmap, func)
+        if self.plot.cbar.scale == 'log':
+            # Now we white-out all those regions
+            #import pdb;pdb.set_trace()
+            to_plot[raw_data == 0.0,:] = 255
+        tf = tempfile.TemporaryFile()
+        write_png_to_file(to_plot, tf)
+        tf.seek(0)
+        img_data = base64.b64encode(tf.read())
+        tf.close()
+        payload = {'xax':xax, 'yax':yax, 'cbar':cbar,
+                   'type': 'widget_payload', 'widget_id': self._ext_widget_id,
+                   'image_data': img_data}
+        ph.add_payload(payload)
+
+    def _convert_ticks(self, tick_locs, bounds, func, height = 400):
+        # height can be a length too; doesn't quite matter.
+        mi, ma = func(bounds)
+        ticks = []
+        for v1,v2 in zip(tick_locs, func(tick_locs)):
+            if v2 < mi or v2 > ma: continue
+            p = height - height * (v2 - mi)/(ma - mi)
+            ticks.append((p,v1,v2))
+            #print v1, v2, mi, ma, height, p
+        return ticks
+
+    def _convert_axis(self, spec):
+        func = lambda a: a
+        if spec.scale == 'log': func = na.log10
+        tick_info = self._convert_ticks(spec.ticks, spec.bounds, func)
+        ax = {'ticks':tick_info,
+              'title': spec.title}
+        return ax
+
+    def _get_cbar_image(self, height = 400, width = 40):
+        # Right now there's just the single 'cmap', but that will eventually
+        # change.  I think?
+        vals = na.mgrid[1:0:height * 1j] * na.ones(width)[:,None]
+        vals = vals.transpose()
+        to_plot = apply_colormap(vals)
+        tf = tempfile.TemporaryFile()
+        write_png_to_file(to_plot, tf)
+        tf.seek(0)
+        img_data = base64.b64encode(tf.read())
+        tf.close()
+        return img_data
+


--- a/yt/visualization/streamlines.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/streamlines.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: University of Colorado
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Samuel Skillman.  All Rights Reserved.
+  Copyright (C) 2010-2011 Samuel Skillman.  All Rights Reserved.
 
   This file is part of yt.
 


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/visualization/tick_locators.py	Mon May 09 15:14:08 2011 -0700
@@ -0,0 +1,163 @@
+##
+## This is a modified version of the LogLocator used in Matplotlib.
+## It is subject to the terms of the BSD license, and copyright is held by the
+## original authors.
+##
+
+import math
+import numpy as na
+
+def is_decade(x,base=10):
+    if x == 0.0:
+        return True
+    lx = math.log(x)/math.log(base)
+    return lx==int(lx)
+
+class LogLocator(object):
+    """
+    Determine the tick locations for log axes
+    """
+
+    def __init__(self, base=10.0, subs=[1.0], numdecs=4):
+        """
+        place ticks on the location= base**i*subs[j]
+        """
+        self.base(base)
+        self.subs(subs)
+        self.numticks = 15
+        self.numdecs = numdecs
+
+    def base(self,base):
+        """
+        set the base of the log scaling (major tick every base**i, i interger)
+        """
+        self._base=base+0.0
+
+    def subs(self,subs):
+        """
+        set the minor ticks the log scaling every base**i*subs[j]
+        """
+        if subs is None:
+            self._subs = None  # autosub
+        else:
+            self._subs = na.asarray(subs)+0.0
+
+    def _set_numticks(self):
+        self.numticks = 15  # todo; be smart here; this is just for dev
+
+    def __call__(self, vmin, vmax):
+        'Return the locations of the ticks'
+        b=self._base
+
+        if vmin <= 0.0:
+            raise ValueError(
+                "Data has no positive values, and therefore can not be log-scaled.")
+
+        vmin = math.log(vmin)/math.log(b)
+        vmax = math.log(vmax)/math.log(b)
+
+        if vmax<vmin:
+            vmin, vmax = vmax, vmin
+
+        numdec = math.floor(vmax)-math.ceil(vmin)
+
+        if self._subs is None: # autosub
+            if numdec>10: subs = na.array([1.0])
+            elif numdec>6: subs = na.arange(2.0, b, 2.0)
+            else: subs = na.arange(2.0, b)
+        else:
+            subs = self._subs
+
+        stride = 1
+        while numdec/stride+1 > self.numticks:
+            stride += 1
+
+        decades = na.arange(math.floor(vmin),
+                             math.ceil(vmax)+stride, stride)
+        if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0):
+            ticklocs = []
+            for decadeStart in b**decades:
+                ticklocs.extend( subs*decadeStart )
+        else:
+            ticklocs = b**decades
+
+        return na.array(ticklocs)
+
+
+class LinearLocator(object):
+    """
+    Determine the tick locations
+
+    The first time this function is called it will try to set the
+    number of ticks to make a nice tick partitioning.  Thereafter the
+    number of ticks will be fixed so that interactive navigation will
+    be nice
+    """
+
+
+    def __init__(self, numticks = None, presets=None):
+        """
+        Use presets to set locs based on lom.  A dict mapping vmin, vmax->locs
+        """
+        self.numticks = numticks
+        if presets is None:
+            self.presets = {}
+        else:
+            self.presets = presets
+
+    def __call__(self, vmin, vmax):
+        'Return the locations of the ticks'
+
+        # vmin, vmax = self.axis.get_view_interval()
+        # vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander = 0.05)
+        if vmax<vmin:
+            vmin, vmax = vmax, vmin
+
+        if (vmin, vmax) in self.presets:
+            return self.presets[(vmin, vmax)]
+
+        if self.numticks is None:
+            self._set_numticks()
+
+
+
+        if self.numticks==0: return []
+        ticklocs = na.linspace(vmin, vmax, self.numticks)
+
+        #return self.raise_if_exceeds(ticklocs)
+        return ticklocs
+
+
+    def _set_numticks(self):
+        self.numticks = 11  # todo; be smart here; this is just for dev
+
+    # def view_limits(self, vmin, vmax):
+    #     'Try to choose the view limits intelligently'
+
+    #     if vmax<vmin:
+    #         vmin, vmax = vmax, vmin
+
+    #     if vmin==vmax:
+    #         vmin-=1
+    #         vmax+=1
+
+    #     exponent, remainder = divmod(math.log10(vmax - vmin), 1)
+
+    #     if remainder < 0.5:
+    #         exponent -= 1
+    #     scale = 10**(-exponent)
+    #     vmin = math.floor(scale*vmin)/scale
+    #     vmax = math.ceil(scale*vmax)/scale
+
+    #     return mtransforms.nonsingular(vmin, vmax)
+
+
+if __name__ == "__main__":
+    ll = LogLocator()
+    print ll(1e-24, 5e-25)
+    print ll(1e-24, 1e-28)
+    print ll(1e-24, 1e-35)
+    lll = LinearLocator()
+    print lll(-1e-24, 1e-24)
+    print lll(-2.3, 1.3)
+    print lll(10,23.)


--- a/yt/visualization/volume_rendering/UBVRI.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/volume_rendering/UBVRI.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: UC Berkeley
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 J.S. Oishi.  All Rights Reserved.
+  Copyright (C) 2010-2011 J.S. Oishi.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/volume_rendering/__init__.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/volume_rendering/__init__.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/volume_rendering/api.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/volume_rendering/api.py	Mon May 09 15:14:08 2011 -0700
@@ -9,7 +9,7 @@
 Affiliation: MSU
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Matthew Turk.  All Rights Reserved.
+  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
   This file is part of yt.
 


--- a/yt/visualization/volume_rendering/image_handling.py	Mon May 09 15:13:46 2011 -0700
+++ b/yt/visualization/volume_rendering/image_handling.py	Mon May 09 15:14:08 2011 -0700
@@ -5,7 +5,7 @@
 Affiliation: University of Colorado at Boulder
 Homepage: http://yt.enzotools.org/
 License:
-  Copyright (C) 2010 Samuel Skillman.  All Rights Reserved.
+  Copyright (C) 2010-2011 Samuel Skillman.  All Rights Reserved.
 
   This file is part of yt.

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list