[Yt-svn] commit/yt: brittonsmith: Fixed bug causing halo profiler to crash if not halo radius

Bitbucket commits-noreply at bitbucket.org
Thu Jun 2 17:31:42 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/18155cfe8290/
changeset:   18155cfe8290
branches:    
user:        brittonsmith
date:        2011-06-03 02:31:36
summary:     Fixed bug causing halo profiler to crash if not halo radius
is provided in halo list file and none has been provided by
hand.  This might happen when we only want to read in a
halo list without doing more profiling.
affected #:  2 files (71 bytes)

--- a/yt/analysis_modules/halo_profiler/halo_filters.py	Thu Jun 02 19:14:30 2011 -0400
+++ b/yt/analysis_modules/halo_profiler/halo_filters.py	Thu Jun 02 18:31:36 2011 -0600
@@ -103,7 +103,7 @@
         index = -2
     else:
         for q in (na.arange(len(overDensity),0,-1)-1):
-            if (overDensity[q] < virial_overdensity) and (overDensity[q-1] > virial_overdensity):
+            if (overDensity[q] < virial_overdensity) and (overDensity[q-1] >= virial_overdensity):
                 index = q - 1
                 break
 


--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Thu Jun 02 19:14:30 2011 -0400
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Thu Jun 02 18:31:36 2011 -0600
@@ -211,10 +211,12 @@
         # Create dataset object.
         self.pf = load(self.dataset)
         self.pf.h
-        if self.halos is 'single' or \
-                not 'r_max' in self.halo_list_format or \
-                halo_radius is not None:
+
+        # Figure out what max radius to use for profiling.
+        if halo_radius is not None:
             self.halo_radius = halo_radius / self.pf[radius_units]
+        elif self.halos is 'single' or not 'r_max' in self.halo_list_format:
+            self.halo_radius = 0.1
         else:
             self.halo_radius = None

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