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

Bitbucket commits-noreply at bitbucket.org
Thu Apr 28 10:36:23 PDT 2011


2 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/9494ce9ac28a/
changeset:   r4223:9494ce9ac28a
branch:      yt
user:        MatthewTurk
date:        2011-04-28 19:35:51
summary:     This should fix CellVolume, dx, dy, dz in non-ortho rays.
affected #:  1 file (98 bytes)

--- a/yt/data_objects/data_containers.py	Thu Apr 28 07:40:05 2011 -0400
+++ b/yt/data_objects/data_containers.py	Thu Apr 28 13:35:51 2011 -0400
@@ -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):


http://bitbucket.org/yt_analysis/yt/changeset/5e949f66ee9e/
changeset:   r4224:5e949f66ee9e
branch:      yt
user:        MatthewTurk
date:        2011-04-28 19:36:15
summary:     Merging
affected #:  1 file (885 bytes)

--- a/yt/analysis_modules/light_ray/light_ray.py	Thu Apr 28 13:35:51 2011 -0400
+++ b/yt/analysis_modules/light_ray/light_ray.py	Thu Apr 28 13:36:15 2011 -0400
@@ -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

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