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

Bitbucket commits-noreply at bitbucket.org
Tue Apr 12 14:15:33 PDT 2011


7 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/5afeb13299c7/
changeset:   r4108:5afeb13299c7
branch:      yt
user:        sskory
date:        2011-04-08 19:23:35
summary:     Changin my email address to my new, hopefully more (very?) permanent one.
affected #:  9 files (114 bytes)

--- a/CREDITS	Wed Apr 06 17:00:56 2011 -0400
+++ b/CREDITS	Fri Apr 08 11:23:35 2011 -0600
@@ -3,7 +3,7 @@
 Developers:                     Matthew Turk (matthewturk at gmail.com)
                                 Britton Smith (brittonsmith at gmail.com)
                                 Jeff Oishi (jsoishi at gmail.com)
-                                Stephen Skory (sskory at physics.ucsd.edu)
+                                Stephen Skory (s at skory.us)
                                 Sam Skillman (samskillman at gmail.com)
                                 Devin Silvia (devin.silvia at gmail.com)
                                 John Wise (jwise at astro.princeton.edu)


--- a/yt/analysis_modules/halo_finding/halo_objects.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/halo_finding/halo_objects.py	Fri Apr 08 11:23:35 2011 -0600
@@ -3,7 +3,7 @@
 
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation: KIPAC/SLAC/Stanford
-Author: Stephen Skory <stephenskory at yahoo.com>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py	Fri Apr 08 11:23:35 2011 -0600
@@ -1,7 +1,7 @@
 """
 A implementation of the HOP algorithm that runs in parallel.
 
-Author: Stephen Skory <sskory at physics.ucsd.edu>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UCSD/CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/analysis_modules/halo_mass_function/halo_mass_function.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/halo_mass_function/halo_mass_function.py	Fri Apr 08 11:23:35 2011 -0600
@@ -1,7 +1,7 @@
 """
 halo_mass_function - Halo Mass Function and supporting functions.
 
-Author: Stephen Skory <sskory at physics.ucsd.edu>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UC San Diego / CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py	Fri Apr 08 11:23:35 2011 -0600
@@ -1,7 +1,7 @@
 """
 MergerTree class and member functions.
 
-Author: Stephen Skory <sskory at physics.ucsd.edu>
+Author: Stephen Skory <s at skory.us>
 Affiliation: CASS/UC San Diego, CA
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/analysis_modules/star_analysis/sfr_spectrum.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/star_analysis/sfr_spectrum.py	Fri Apr 08 11:23:35 2011 -0600
@@ -1,7 +1,7 @@
 """
 StarAnalysis - Functions to analyze stars.
 
-Author: Stephen Skory <sskory at physics.ucsd.edu>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UC San Diego / CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/analysis_modules/two_point_functions/two_point_functions.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/analysis_modules/two_point_functions/two_point_functions.py	Fri Apr 08 11:23:35 2011 -0600
@@ -1,7 +1,7 @@
 """
 Two Point Functions Framework.
 
-Author: Stephen Skory <stephenskory at yahoo.com>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/utilities/math_utils.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/utilities/math_utils.py	Fri Apr 08 11:23:35 2011 -0600
@@ -3,7 +3,7 @@
 
 Author: Matthew Turk <matthewturk at gmail.com>
 Affiliation: UCSD Physics/CASS
-Author: Stephen Skory <stephenskory at yahoo.com>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UCSD Physics/CASS
 Homepage: http://yt.enzotools.org/
 License:


--- a/yt/visualization/plot_modifications.py	Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/visualization/plot_modifications.py	Fri Apr 08 11:23:35 2011 -0600
@@ -5,7 +5,7 @@
 Affiliation: KIPAC/SLAC/Stanford
 Author: J. S. Oishi <jsoishi at astro.berkeley.edu>
 Affiliation: UC Berkeley
-Author: Stephen Skory <sskory at physics.ucsd.edu>
+Author: Stephen Skory <s at skory.us>
 Affiliation: UC San Diego
 Homepage: http://yt.enzotools.org/
 License:


http://bitbucket.org/yt_analysis/yt/changeset/0d3d940e1f98/
changeset:   r4109:0d3d940e1f98
branch:      yt
user:        sskory
date:        2011-04-08 23:39:48
summary:     Progress on the halo_profiler centering functions.
affected #:  4 files (5.4 KB)

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/analysis_modules/halo_profiler/centering_methods.py	Fri Apr 08 15:39:48 2011 -0600
@@ -0,0 +1,88 @@
+"""
+HaloProfiler re-centering functions.
+
+Author: Stephen Skory <s at skory.us>
+Affiliation: CASA/University of CO, Boulder
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2008-2011 Stephen Skory.  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 numpy as na
+
+from yt.funcs import *
+
+from yt.data_objects.field_info_container import \
+    add_field
+
+centering_registry = {}
+
+def add_function(name):
+   def wrapper(func):
+       centering_registry[name] = func
+       return func
+   return wrapper
+
+#### Density ####
+
+def _MatterDensityXTotalMass(field, data):
+    return na.power((data['Dark_Matter_Density'] * data['TotalMassMsun']), 
+                    self.density_center_exponent)
+def _Convert_MatterDensityXTotalMass(data):
+    return 1
+add_field("MatterDensityXTotalMass", units=r"",
+          function=_MatterDensityXTotalMass,
+          convert_function=_Convert_MatterDensityXTotalMass)
+
+ at add_function("Min_Dark_Matter_Density")
+def find_minimum_dm_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('MatterDensityXTotalMass')
+    return [mx,my,mz]
+
+ at add_function("Max_Dark_Matter_Density")
+def find_maximum_dm_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('MatterDensityXTotalMass')
+    return [mx,my,mz]
+
+ at add_function("CoM_Dark_Matter_Density")
+def find_CoM_dm_density(data):
+    dc_x = data.quantities['WeightedAverageQuantity']('x', 'MatterDensityXTotalMass')
+    dc_y = data.quantities['WeightedAverageQuantity']('y', 'MatterDensityXTotalMass')
+    dc_z = data.quantities['WeightedAverageQuantity']('z', 'MatterDensityXTotalMass')
+    return [dc_x, dc_y, dc_z]
+
+#### Temperature ####
+
+def _TemperatureXTotalMass(field, data):
+    return (data['Temperature'] * data['TotalMassMsun'])
+def _Convert_TemperatureXTotalMass(data):
+    return 1
+add_field("TemperatureXTotalMass", units=r"",
+          function=_TemperatureXTotalMass,
+          convert_function=_Convert_TemperatureXTotalMass)
+
+ at add_function("Min_Temperature")
+def find_minimum_temperature(data):
+    ma, mini, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXTotalMass')
+    return [mx,my,mz]
+
+ at add_function("Max_Temperature")
+def find_maximum_temperature(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXTotalMass')
+    return [mx,my,mz]
+


--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Fri Apr 08 11:23:35 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Fri Apr 08 15:39:48 2011 -0600
@@ -37,6 +37,8 @@
 from yt.analysis_modules.halo_finding.api import *
 from .halo_filters import \
     VirialFilter
+from .centering_methods import \
+    centering_registry
 from yt.data_objects.field_info_container import \
     add_field
 
@@ -60,8 +62,8 @@
                                          dm_only=False, resize=True, 
                                          fancy_padding=True, rearrange=True),
                  use_density_center=False, density_center_exponent=1.0,
-                 use_field_max_center=None,
                  halo_radius=0.1, radius_units='1', n_profile_bins=50,
+                 recenter = None,
                  profile_output_dir='radial_profiles', projection_output_dir='projections',
                  projection_width=8.0, projection_width_units='mpc', project_at_level='max',
                  velocity_center=['bulk', 'halo'], filter_quantities=['id','center']):
@@ -86,14 +88,8 @@
                Default: HaloFinder (yt_hop).
         :param halo_finder_args (tuple): args given with call to halo finder function.  Default: None.
         :param halo_finder_kwargs (dict): kwargs given with call to halo finder function. Default: None.
-        :param use_density_center (bool): re-center halos before performing profiles with an center of mass 
-               weighted by overdensity.  This is generally not needed.  Default: False.
-        :param density_center_exponent (float): when use_density_center set to True, this specifies the 
-               exponent, alpha, such that the halo center calculation is weighted by overdensity^alpha.  
-               Default: 1.0.
-        :param use_field_max_center (str): another alternative for halo re-centering by selecting the 
-               location of the maximum of the field given by this keyword.  This is generally not needed.  
-               Default: None.
+        :param recenter (str or function name): The name of a function that
+               recenters the halo.
         :param halo_radius (float): if no halo radii are provided in the halo list file, this parameter is 
                used to specify the radius out to which radial profiles will be made.  This keyword is also 
                used when halos is set to single.  Default: 0.1.
@@ -175,23 +171,8 @@
             mylog.error("Keyword, halo_list_format, must be 'yt_hop', 'enzo_hop', 'p-groupfinder', or a dictionary of custom settings.")
             return None
 
-        # Option to recenter sphere on density center.
-        self.use_density_center = use_density_center
-        self.density_center_exponent = density_center_exponent
-        if self.use_density_center:
-            def _MatterDensityXTotalMass(field, data):
-                return na.power((data['Matter_Density'] * data['TotalMassMsun']), 
-                                self.density_center_exponent)
-            def _Convert_MatterDensityXTotalMass(data):
-                return 1
-            add_field("MatterDensityXTotalMass", units=r"",
-                      function=_MatterDensityXTotalMass,
-                      convert_function=_Convert_MatterDensityXTotalMass)
-
-        # Option to recenter sphere on the location of a field max.
-        self.use_field_max_center = use_field_max_center
-        if self.use_field_max_center is not None:
-            self.use_density_center = False
+        # Option to recenter sphere someplace else.
+        self.recenter = recenter
 
         # Look for any field that might need to have the bulk velocity set.
         self._need_bulk_velocity = False
@@ -377,18 +358,14 @@
             if len(sphere._grids) == 0: return None
             new_sphere = False
 
-            if self.use_density_center:
-                dc_x = sphere.quantities['WeightedAverageQuantity']('x', 'MatterDensityXTotalMass')
-                dc_y = sphere.quantities['WeightedAverageQuantity']('y', 'MatterDensityXTotalMass')
-                dc_z = sphere.quantities['WeightedAverageQuantity']('z', 'MatterDensityXTotalMass')
-                mylog.info("Moving halo center from %s to %s." % (halo['center'], [dc_x, dc_y, dc_z]))
-                halo['center'] = [dc_x, dc_y, dc_z]
-                new_sphere = True
-
-            if self.use_field_max_center is not None:
-                ma, maxi, mx, my, mz, mg = sphere.quantities['MaxLocation'](self.use_field_max_center)
-                mylog.info("Moving halo center from %s to %s." % (halo['center'], [mx, my, mz]))
-                halo['center'] = [mx, my, mz]
+            if self.recenter:
+                if self.recenter in centering_registry:
+                    new_x, new_y, new_z = \
+                        centering_registry[self.recenter](sphere)
+                else:
+                    # user supplied function
+                    new_x, new_y, new_z = self.recenter(sphere)
+                halo['center'] = [new_x, new_y, new_z]
                 new_sphere = True
 
             if new_sphere:
@@ -558,12 +535,10 @@
                         if save_cube:
                             if dataset_name in output.listnames(): del output[dataset_name]
                             output.create_dataset(dataset_name, data=frb[hp['field']])
-
                         if save_images:
                             filename = "%s/Halo_%04d_%s_%s.png" % (my_output_dir, halo['id'], 
                                                                    dataset_name, axis_labels[w])
                             write_image(na.log10(frb[hp['field']]), filename, cmap_name=hp['cmap'])
-
                     if save_cube: output.close()
 
             del region


--- a/yt/data_objects/derived_quantities.py	Fri Apr 08 11:23:35 2011 -0600
+++ b/yt/data_objects/derived_quantities.py	Fri Apr 08 15:39:48 2011 -0600
@@ -610,6 +610,26 @@
 add_quantity("MaxLocation", function=_MaxLocation,
              combine_function=_combMaxLocation, n_ret = 6)
 
+def _MinLocation(data, field):
+    """
+    This function returns the location of the minimum of a set
+    of fields.
+    """
+    ma, mini, mx, my, mz, mg = 1e90, -1, -1, -1, -1, -1
+    if data[field].size > 0:
+        mini = na.argmin(data[field])
+        ma = data[field][mini]
+        mx, my, mz = [data[ax][mini] for ax in 'xyz']
+        mg = data["GridIndices"][mini]
+    return (ma, mini, mx, my, mz, mg)
+def _combMinLocation(data, *args):
+    args = [na.atleast_1d(arg) for arg in args]
+    i = na.argmin(args[0]) # ma is arg[0]
+    return [arg[i] for arg in args]
+add_quantity("MinLocation", function=_MinLocation,
+             combine_function=_combMinLocation, n_ret = 6)
+
+
 def _TotalQuantity(data, fields):
     """
     This function sums up a given field over the entire region


--- a/yt/utilities/setup.py	Fri Apr 08 11:23:35 2011 -0600
+++ b/yt/utilities/setup.py	Fri Apr 08 15:39:48 2011 -0600
@@ -147,6 +147,7 @@
     config.add_subpackage("answer_testing")
     config.add_subpackage("delaunay") # From SciPy, written by Robert Kern
     config.add_subpackage("kdtree")
+    config.add_data_files(('kdtree', ['kdtree/fKDpy.so',]))
     config.add_subpackage("parallel_tools")
     config.add_extension("data_point_utilities",
                 "yt/utilities/data_point_utilities.c", libraries=["m"])


http://bitbucket.org/yt_analysis/yt/changeset/e36b8a005d2a/
changeset:   r4110:e36b8a005d2a
branch:      yt
user:        sskory
date:        2011-04-12 20:51:38
summary:     More work on functions to recenter halo profiling.
affected #:  2 files (342 bytes)

--- a/yt/analysis_modules/halo_profiler/centering_methods.py	Fri Apr 08 15:39:48 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/centering_methods.py	Tue Apr 12 12:51:38 2011 -0600
@@ -42,7 +42,7 @@
 
 def _MatterDensityXTotalMass(field, data):
     return na.power((data['Dark_Matter_Density'] * data['TotalMassMsun']), 
-                    self.density_center_exponent)
+                    1.)
 def _Convert_MatterDensityXTotalMass(data):
     return 1
 add_field("MatterDensityXTotalMass", units=r"",


--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Fri Apr 08 15:39:48 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Tue Apr 12 12:51:38 2011 -0600
@@ -29,6 +29,7 @@
 import types
 
 from yt.funcs import *
+from yt.utilities.math_utils import periodic_dist
 
 from yt.convenience import \
     load
@@ -359,6 +360,7 @@
             new_sphere = False
 
             if self.recenter:
+                old = halo['center']
                 if self.recenter in centering_registry:
                     new_x, new_y, new_z = \
                         centering_registry[self.recenter](sphere)
@@ -366,6 +368,10 @@
                     # user supplied function
                     new_x, new_y, new_z = self.recenter(sphere)
                 halo['center'] = [new_x, new_y, new_z]
+                d = periodic_dist(old, halo['center'],
+                    self.pf.domain_right_edge - self.pf.domain_left_edge) * \
+                    self.pf['kpc']
+                mylog.info("Recentered %1.3e kpc away." % d)
                 new_sphere = True
 
             if new_sphere:


http://bitbucket.org/yt_analysis/yt/changeset/10da12006605/
changeset:   r4111:10da12006605
branch:      yt
user:        sskory
date:        2011-04-12 20:52:05
summary:     Merge.
affected #:  6 files (8.5 KB)

--- a/yt/analysis_modules/halo_finding/halo_objects.py	Tue Apr 12 12:51:38 2011 -0600
+++ b/yt/analysis_modules/halo_finding/halo_objects.py	Tue Apr 12 12:52:05 2011 -0600
@@ -856,7 +856,7 @@
         # First get the list of fields from the first file. Not all fields
         # are saved all the time (e.g. creation_time, particle_type).
         mylog.info("Getting field %s from hdf5 halo particle files." % field)
-        f = h5py.File(fnames[0])
+        f = h5py.File(fnames[0], 'r')
         fields = f["Halo%08d" % halo].keys()
         # If we dont have this field, we can give up right now.
         if field not in fields: return None
@@ -866,14 +866,19 @@
         else:
             field_data = na.empty(size, dtype='float64')
         f.close()
+        # Apparently, there's a bug in h5py that was keeping the file pointer
+        # f closed, even though it's re-opened below. This del seems to fix
+        # that.
+        del f
         offset = 0
         for fname in fnames:
-            f = h5py.File(fname)
+            f = h5py.File(fname, 'r')
             this = f["Halo%08d" % halo][field][:]
             s = this.size
             field_data[offset:offset+s] = this
             offset += s
             f.close()
+            del f
         return field_data
         
     def center_of_mass(self):


--- a/yt/gui/reason/extdirect_repl.py	Tue Apr 12 12:51:38 2011 -0600
+++ b/yt/gui/reason/extdirect_repl.py	Tue Apr 12 12:52:05 2011 -0600
@@ -150,6 +150,10 @@
         return self.payload_handler.deliver_payloads()
 
     def _check_heartbeat(self):
+        if self.server is not None:
+            if not all((s._monitor.is_alive() for s in self.server.values())):
+                self.shutdown()
+                return
         if time.time() - self.last_heartbeat > self.timeout:
             print "Shutting down after a timeout of %s" % (self.timeout)
             #sys.exit(0)
@@ -157,9 +161,7 @@
             # server instance by default.
             self.shutdown()
             return
-        print "Not shutting down from timeout."
-        self._heartbeat_timer = threading.Timer(self.timeout - 60,
-                                    self._check_heartbeat)
+        self._heartbeat_timer = threading.Timer(10, self._check_heartbeat)
         self._heartbeat_timer.start()
 
     def shutdown(self):


--- a/yt/gui/reason/html/index.html	Tue Apr 12 12:51:38 2011 -0600
+++ b/yt/gui/reason/html/index.html	Tue Apr 12 12:52:05 2011 -0600
@@ -86,6 +86,9 @@
     <!-- THE MAIN FUNCTION --><script type="text/javascript" src="js/reason.js"></script>
 
+    <!-- THE MENU ITEMS AND FUNCTIONS -->
+    <script type="text/javascript" src="js/menu_items.js"></script>
+
     <!-- THE PLOT WINDOW FUNCTIONS --><script type="text/javascript" src="js/widget_plotwindow.js"></script></head>


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/gui/reason/html/js/menu_items.js	Tue Apr 12 12:52:05 2011 -0600
@@ -0,0 +1,107 @@
+/**********************************************************************
+The main GUI facility for Reason
+
+Author: Cameron Hummels <chummels at gmail.com>
+Affiliation: Columbia
+Author: Jeffrey S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: MSU
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: NSF / Columbia
+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 main_menu = {
+    text: 'Menu',
+    id: 'main_menu',
+    menu: [
+           {xtype:'menuitem', text: 'Open', disabled: true},
+           {xtype:'menuitem', text: 'Open Directory', disabled: true},
+           {xtype: 'menuseparator'},
+           {xtype:'menuitem', text: 'Save Script',
+	            handler: function (b,e) { 
+                    Ext.Msg.prompt("We have important work to do.", 
+                    "Enter filename.", 
+                    function(btn, text) {
+                        if (btn == 'ok'){
+                            yt_rpc.ExtDirectREPL.save_session({filename:text}, 
+                            function(f, a) {
+                                if (a.result['status'] == 'SUCCESS') {
+                                    var alert_text = 'Saved session to ' + 
+                                    a.result['filename']
+                                    Ext.Msg.alert('Success!', alert_text);
+                                    var record = new logging_store.recordType(
+                                        {record: alert_text });
+                                    logging_store.add(record, number_log_records++);
+							    } else {
+							        Ext.Msg.alert('Always naysaying!',
+                                        'Failed to save to ' + 
+                                        a.result['filename'] + 
+                                        '<br>Error: ' + 
+                                        a.result['error']);
+                                }
+                            });
+                        }
+                    });
+                } },
+           {xtype:'menuitem', text: 'Download Script',
+                handler: function(b, e) { 
+                    window.open("session.py", "_top"); 
+                    var record = new logging_store.recordType({
+                        record: 'Saved session locally.'});
+                    logging_store.add(record, number_log_records++);
+                    }},
+           {xtype:'menuitem', text: 'Pastebin Script',
+                handler: function (b,e) { 
+                    yt_rpc.ExtDirectREPL.paste_session({}, function(f, a) {
+                        if (a.result['status'] == 'SUCCESS') {
+                            var alert_text = 'Pasted session to:<br>' + 
+                            a.result['site']
+                            var alert_text_rec = 'Pasted session to: ' + 
+                            a.result['site']
+                            Ext.Msg.alert('Pastebin', alert_text);
+                            var record = new logging_store.recordType(
+                                {record: alert_text_rec });
+                            logging_store.add(record, number_log_records++);
+                        }
+                    }); 
+                }},
+           {xtype: 'menuseparator'},
+           {xtype:'menuitem', text: 'Help',
+                handler: function (b,e) { 
+                        window.open("help.html", "_new");
+            }},
+           {xtype:'menuitem', text: 'yt Chat',
+                handler: function (b,e) { 
+                        window.open("http://yt.enzotools.org/irc.html", "_new");
+            }},
+           {xtype: 'menuseparator'},
+           {xtype:'menuitem', text: 'Quit',
+             handler: function(b,e) {
+                yt_rpc.ExtDirectREPL.shutdown({}, function(f,a) { 
+                Ext.Msg.alert("Goodbye!", "Goodbye from Reason!", function() {
+                window.open("http://www.google.com/", "_top");});});
+                }
+           },
+                
+        ],
+};
+


--- a/yt/gui/reason/html/js/reason.js	Tue Apr 12 12:51:38 2011 -0600
+++ b/yt/gui/reason/html/js/reason.js	Tue Apr 12 12:52:05 2011 -0600
@@ -192,88 +192,6 @@
           }
     });
 
-    var ButtonGroupPanel = new Ext.Panel({
-        layout: 'anchor',
-        ButtonAlign: 'center',
-        collapsible: false,
-        renderTo: document.body,
-        tbar: [{
-            xtype: 'buttongroup',
-            columns: 7,
-            items: [{
-                text: 'Download',
-                layout:'anchor',
-                anchor: '100% 25%',
-                handler: function(b, e) { 
-                    window.open("session.py", "_top"); 
-                    var record = new logging_store.recordType({
-                        record: 'Saved session locally.'});
-                    logging_store.add(record, number_log_records++);
-	            }
-            },{
-                xtype: 'tbseparator'
-            },{
-                text: 'Save',
-                layout:'anchor',
-	            anchor: '100% 50%',
-	            handler: function (b,e) { 
-                    Ext.Msg.prompt("We have important work to do.", 
-                    "Enter filename.", 
-                    function(btn, text) {
-                        if (btn == 'ok'){
-                            yt_rpc.ExtDirectREPL.save_session({filename:text}, 
-                            function(f, a) {
-                                if (a.result['status'] == 'SUCCESS') {
-                                    var alert_text = 'Saved session to ' + 
-                                    a.result['filename']
-                                    Ext.Msg.alert('Success!', alert_text);
-                                    var record = new logging_store.recordType(
-                                        {record: alert_text });
-                                    logging_store.add(record, number_log_records++);
-							    } else {
-							        Ext.Msg.alert('Always naysaying!',
-                                        'Failed to save to ' + 
-                                        a.result['filename'] + 
-                                        '<br>Error: ' + 
-                                        a.result['error']);
-                                }
-                            });
-                        }
-                    });
-                }
-            },{
-                xtype: 'tbseparator'
-            },{
-                text: 'Paste',
-                layout:'anchor',
-                anchor: '100% 75%',
-                handler: function (b,e) { 
-                    yt_rpc.ExtDirectREPL.paste_session({}, function(f, a) {
-                        if (a.result['status'] == 'SUCCESS') {
-                            var alert_text = 'Pasted session to:<br>' + 
-                            a.result['site']
-                            var alert_text_rec = 'Pasted session to: ' + 
-                            a.result['site']
-                            Ext.Msg.alert('Pastebin', alert_text);
-                            var record = new logging_store.recordType(
-                                {record: alert_text_rec });
-                            logging_store.add(record, number_log_records++);
-                        }
-                    }); 
-                }
-            },{
-                xtype: 'tbseparator'
-            },{
-                text: 'Help',
-                layout:'anchor',
-                anchor: '100% 100%',
-                handler: function (b,e) { 
-                        window.open("help.html", "_new");
-                }
-            }]
-        }]
-    });
-
     var status_panel;
     var logging_store = new Ext.data.Store({
         fields: [{name:'record'}],
@@ -330,8 +248,10 @@
                         type: 'anchor',
                     },
                     items: [
+                        {xtype: 'toolbar',
+                          items: [ main_menu ],
+                        },
                         treePanel,
-                        ButtonGroupPanel
                     ]
 		  // in this instance the TabPanel is not wrapped by another panel
 		  // since no title is needed, this Panel is added directly


--- a/yt/visualization/fixed_resolution.py	Tue Apr 12 12:51:38 2011 -0600
+++ b/yt/visualization/fixed_resolution.py	Tue Apr 12 12:52:05 2011 -0600
@@ -23,6 +23,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
 
+from yt.funcs import *
 from yt.utilities.definitions import \
     x_dict, \
     y_dict, \
@@ -106,6 +107,8 @@
 
     def __getitem__(self, item):
         if item in self.data: return self.data[item]
+        mylog.info("Making a fixed resolution buffer of %d by %d" % \
+            (self.buff_size[0], self.buff_size[1]))
         buff = _MPL.Pixelize(self.data_source['px'],
                              self.data_source['py'],
                              self.data_source['pdx'],


http://bitbucket.org/yt_analysis/yt/changeset/2d617fe55cef/
changeset:   r4112:2d617fe55cef
branch:      yt
user:        sskory
date:        2011-04-12 21:55:55
summary:     More recentering methods.
affected #:  1 file (2.0 KB)

--- a/yt/analysis_modules/halo_profiler/centering_methods.py	Tue Apr 12 12:52:05 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/centering_methods.py	Tue Apr 12 13:55:55 2011 -0600
@@ -38,51 +38,106 @@
        return func
    return wrapper
 
-#### Density ####
+#### Dark Matter Density ####
 
-def _MatterDensityXTotalMass(field, data):
-    return na.power((data['Dark_Matter_Density'] * data['TotalMassMsun']), 
-                    1.)
-def _Convert_MatterDensityXTotalMass(data):
+def _MatterDensityXDMMass(field, data):
+    return (data['Dark_Matter_Density'] * data['Dark_Matter_Density'] \
+        * data["CellVolume"])
+def _Convert_MatterDensityXDMMass(data):
     return 1
-add_field("MatterDensityXTotalMass", units=r"",
-          function=_MatterDensityXTotalMass,
-          convert_function=_Convert_MatterDensityXTotalMass)
+add_field("MatterDensityXDMMass", units=r"",
+          function=_MatterDensityXDMMass,
+          convert_function=_Convert_MatterDensityXDMMass)
 
 @add_function("Min_Dark_Matter_Density")
 def find_minimum_dm_density(data):
-    ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('MatterDensityXTotalMass')
+    ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('MatterDensityXDMMass')
     return [mx,my,mz]
 
 @add_function("Max_Dark_Matter_Density")
 def find_maximum_dm_density(data):
-    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('MatterDensityXTotalMass')
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('MatterDensityXDMMass')
     return [mx,my,mz]
 
 @add_function("CoM_Dark_Matter_Density")
 def find_CoM_dm_density(data):
-    dc_x = data.quantities['WeightedAverageQuantity']('x', 'MatterDensityXTotalMass')
-    dc_y = data.quantities['WeightedAverageQuantity']('y', 'MatterDensityXTotalMass')
-    dc_z = data.quantities['WeightedAverageQuantity']('z', 'MatterDensityXTotalMass')
+    dc_x = data.quantities['WeightedAverageQuantity']('x', 'MatterDensityXDMMass')
+    dc_y = data.quantities['WeightedAverageQuantity']('y', 'MatterDensityXDMMass')
+    dc_z = data.quantities['WeightedAverageQuantity']('z', 'MatterDensityXDMMass')
+    return [dc_x, dc_y, dc_z]
+
+#### Gas Density ####
+
+def _GasDensityXCellMass(field, data):
+    return (data['Density'] * data['CellMassMsun'])
+def _Convert_GasDensityXCellMass(data):
+    return 1
+add_field("GasDensityXCellMass", units=r"",
+          function=_GasDensityXCellMass,
+          convert_function=_Convert_GasDensityXCellMass)
+
+ at add_function("Min_Gas_Density")
+def find_minimum_gas_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('GasDensityXCellMass')
+    return [mx,my,mz]
+
+ at add_function("Max_Gas_Density")
+def find_maximum_gas_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('GasDensityXCellMass')
+    return [mx,my,mz]
+
+ at add_function("CoM_Gas_Density")
+def find_CoM_gas_density(data):
+    dc_x = data.quantities['WeightedAverageQuantity']('x', 'GasDensityXCellMass')
+    dc_y = data.quantities['WeightedAverageQuantity']('y', 'GasDensityXCellMass')
+    dc_z = data.quantities['WeightedAverageQuantity']('z', 'GasDensityXCellMass')
+    return [dc_x, dc_y, dc_z]
+
+#### Total Density ####
+
+def _TotalDensityXTotalMass(field, data):
+    return (data['Density'] + data['Dark_Matter_Density']) * \
+        data['TotalMassMsun'])
+def _Convert_TotalDensityXTotalMass(data):
+    return 1
+add_field("TotalDensityXTotalMass", units=r"",
+          function=_TotalDensityXTotalMass,
+          convert_function=_Convert_TotalDensityXTotalMass)
+
+ at add_function("Min_Total_Density")
+def find_minimum_total_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MinLocation']('TotalDensityXTotalMass')
+    return [mx,my,mz]
+
+ at add_function("Max_Total_Density")
+def find_maximum_total_density(data):
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('TotalDensityXTotalMass')
+    return [mx,my,mz]
+
+ at add_function("CoM_Total_Density")
+def find_CoM_total_density(data):
+    dc_x = data.quantities['WeightedAverageQuantity']('x', 'TotalDensityXTotalMass')
+    dc_y = data.quantities['WeightedAverageQuantity']('y', 'TotalDensityXTotalMass')
+    dc_z = data.quantities['WeightedAverageQuantity']('z', 'TotalDensityXTotalMass')
     return [dc_x, dc_y, dc_z]
 
 #### Temperature ####
 
-def _TemperatureXTotalMass(field, data):
-    return (data['Temperature'] * data['TotalMassMsun'])
-def _Convert_TemperatureXTotalMass(data):
+def _TemperatureXCellMass(field, data):
+    return (data['Temperature'] * data['CellMassMsun'])
+def _Convert_TemperatureXCellMass(data):
     return 1
-add_field("TemperatureXTotalMass", units=r"",
-          function=_TemperatureXTotalMass,
-          convert_function=_Convert_TemperatureXTotalMass)
+add_field("TemperatureXCellMass", units=r"",
+          function=_TemperatureXCellMass,
+          convert_function=_Convert_TemperatureXCellMass)
 
 @add_function("Min_Temperature")
 def find_minimum_temperature(data):
-    ma, mini, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXTotalMass')
+    ma, mini, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXCellMass')
     return [mx,my,mz]
 
 @add_function("Max_Temperature")
 def find_maximum_temperature(data):
-    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXTotalMass')
+    ma, maxi, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXCellMass')
     return [mx,my,mz]
 


http://bitbucket.org/yt_analysis/yt/changeset/98ebf641be8c/
changeset:   r4113:98ebf641be8c
branch:      yt
user:        sskory
date:        2011-04-12 23:12:52
summary:     Adding ability to skip recentering and profiling of a halo if
recentering moves too far, or for some other reason.
affected #:  2 files (336 bytes)

--- a/yt/analysis_modules/halo_profiler/centering_methods.py	Tue Apr 12 13:55:55 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/centering_methods.py	Tue Apr 12 15:12:52 2011 -0600
@@ -97,7 +97,7 @@
 
 def _TotalDensityXTotalMass(field, data):
     return (data['Density'] + data['Dark_Matter_Density']) * \
-        data['TotalMassMsun'])
+        data['TotalMassMsun']
 def _Convert_TotalDensityXTotalMass(data):
     return 1
 add_field("TotalDensityXTotalMass", units=r"",
@@ -133,7 +133,7 @@
 
 @add_function("Min_Temperature")
 def find_minimum_temperature(data):
-    ma, mini, mx, my, mz, mg = data.quantities['MaxLocation']('TemperatureXCellMass')
+    ma, mini, mx, my, mz, mg = data.quantities['MinLocation']('TemperatureXCellMass')
     return [mx,my,mz]
 
 @add_function("Max_Temperature")


--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Tue Apr 12 13:55:55 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Tue Apr 12 15:12:52 2011 -0600
@@ -367,6 +367,12 @@
                 else:
                     # user supplied function
                     new_x, new_y, new_z = self.recenter(sphere)
+                if new_x < self.pf.domain_left_edge[0] or \
+                        new_y < self.pf.domain_left_edge[1] or \
+                        new_z < self.pf.domain_left_edge[2]:
+                    mylog.info("Recentering moves too far, skipping halo %d" % \
+                        halo['id'])
+                    return None
                 halo['center'] = [new_x, new_y, new_z]
                 d = periodic_dist(old, halo['center'],
                     self.pf.domain_right_edge - self.pf.domain_left_edge) * \


http://bitbucket.org/yt_analysis/yt/changeset/57019e5bd442/
changeset:   r4114:57019e5bd442
branch:      yt
user:        sskory
date:        2011-04-12 23:15:00
summary:     Merge.
affected #:  1 file (0 bytes)

--- a/doc/install_script.sh	Tue Apr 12 15:12:52 2011 -0600
+++ b/doc/install_script.sh	Tue Apr 12 15:15:00 2011 -0600
@@ -291,7 +291,7 @@
 get_enzotools matplotlib-1.0.0.tar.gz
 get_enzotools mercurial-1.8.1.tar.gz
 get_enzotools ipython-0.10.tar.gz
-get_enzotools h5py-1.2.0.tar.gz
+get_enzotools h5py-1.3.1.tar.gz
 get_enzotools Cython-0.14.tar.gz
 get_enzotools Forthon-0.8.4.tar.gz
 get_enzotools ext-3.3.2.zip
@@ -498,7 +498,7 @@
 [ -n "${OLD_CXXFLAGS}" ] && export CXXFLAGS=${OLD_CXXFLAGS}
 [ -n "${OLD_CFLAGS}" ] && export CFLAGS=${OLD_CFLAGS}
 do_setup_py ipython-0.10
-do_setup_py h5py-1.2.0
+do_setup_py h5py-1.3.1
 do_setup_py Cython-0.14
 [ $INST_FORTHON -eq 1 ] && do_setup_py Forthon-0.8.4

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