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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue May 14 07:16:52 PDT 2013


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/e239f4ab1d56/
Changeset:   e239f4ab1d56
Branch:      yt
User:        brittonsmith
Date:        2013-05-13 17:12:33
Summary:     Making sure light ray does not fail if there are no halos in the dataset.
Affected #:  1 file

diff -r c3fb92bd4c79c53cde2e71ef6119a9f8afe4ec1a -r e239f4ab1d563cc5ec635d4cc495fa5f43c7df02 yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -461,7 +461,7 @@
     def _get_nearest_halo_properties(self, data, halo_list, fields=None):
         """
         Calculate distance to nearest object in halo list for each lixel in data.
-        Return list of distances and masses of nearest objects.
+        Return list of distances and other properties of nearest objects.
         """
 
         if fields is None: fields = []
@@ -475,17 +475,18 @@
         nearest_distance = np.zeros(data['x'].shape)
         field_data = dict([(field, np.zeros(data['x'].shape)) \
                            for field in fields])
-        for index in xrange(nearest_distance.size):
-            nearest = np.argmin(periodic_distance(np.array([data['x'][index],
-                                                            data['y'][index],
-                                                            data['z'][index]]),
-                                                  halo_centers))
-            nearest_distance[index] = periodic_distance(np.array([data['x'][index],
-                                                                  data['y'][index],
-                                                                  data['z'][index]]),
-                                                        halo_centers[nearest])
-            for field in fields:
-                field_data[field][index] = halo_field_values[field][nearest]
+        if halo_centers.size > 0:
+            for index in xrange(nearest_distance.size):
+                nearest = np.argmin(periodic_distance(np.array([data['x'][index],
+                                                                data['y'][index],
+                                                                data['z'][index]]),
+                                                      halo_centers))
+                nearest_distance[index] = periodic_distance(np.array([data['x'][index],
+                                                                      data['y'][index],
+                                                                      data['z'][index]]),
+                                                            halo_centers[nearest])
+                for field in fields:
+                    field_data[field][index] = halo_field_values[field][nearest]
 
         return_data = {'nearest_halo': nearest_distance}
         for field in fields:
@@ -541,6 +542,9 @@
 
 def periodic_distance(coord1, coord2):
     "Calculate length of shortest vector between to points in periodic domain."
+
+    print coord1, coord2
+    
     dif = coord1 - coord2
 
     dim = np.ones(coord1.shape,dtype=int)


https://bitbucket.org/yt_analysis/yt/commits/fed9831bccbc/
Changeset:   fed9831bccbc
Branch:      yt
User:        brittonsmith
Date:        2013-05-13 17:21:27
Summary:     Removing wild print statement.
Affected #:  1 file

diff -r e239f4ab1d563cc5ec635d4cc495fa5f43c7df02 -r fed9831bccbcc10849a02ed0f3d6f1f5bea3dba2 yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -543,8 +543,6 @@
 def periodic_distance(coord1, coord2):
     "Calculate length of shortest vector between to points in periodic domain."
 
-    print coord1, coord2
-    
     dif = coord1 - coord2
 
     dim = np.ones(coord1.shape,dtype=int)


https://bitbucket.org/yt_analysis/yt/commits/661c6d72d65e/
Changeset:   661c6d72d65e
Branch:      yt
User:        brittonsmith
Date:        2013-05-13 17:27:04
Summary:     Removing extra blank line.
Affected #:  1 file

diff -r fed9831bccbcc10849a02ed0f3d6f1f5bea3dba2 -r 661c6d72d65ef4666610812f898b73de213c58c3 yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -542,7 +542,6 @@
 
 def periodic_distance(coord1, coord2):
     "Calculate length of shortest vector between to points in periodic domain."
-
     dif = coord1 - coord2
 
     dim = np.ones(coord1.shape,dtype=int)

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