[Yt-svn] yt: Adding a sparse coordinate generator for the fixed res proje...

hg at spacepope.org hg at spacepope.org
Thu Apr 22 15:29:51 PDT 2010


hg Repository: yt
details:   yt/rev/f5829f145bcd
changeset: 1588:f5829f145bcd
user:      Matthew Turk <matthewturk at gmail.com>
date:
Thu Apr 22 15:29:46 2010 -0700
description:
Adding a sparse coordinate generator for the fixed res projections, which
should be useful in large fixed-res projection sizes

diffstat:

 yt/lagos/BaseDataTypes.py |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r f7da016e73fe -r f5829f145bcd yt/lagos/BaseDataTypes.py
--- a/yt/lagos/BaseDataTypes.py	Thu Apr 22 11:10:44 2010 -0700
+++ b/yt/lagos/BaseDataTypes.py	Thu Apr 22 15:29:46 2010 -0700
@@ -1507,13 +1507,15 @@
     def _generate_coords(self):
         xi, yi, zi = self.left_edge + self.dds*0.5
         xf, yf, zf = self.left_edge + self.dds*(self.ActiveDimensions-0.5)
-        coords = na.mgrid[xi:xf:self.ActiveDimensions[0]*1j,
+        coords = na.ogrid[xi:xf:self.ActiveDimensions[0]*1j,
                           yi:yf:self.ActiveDimensions[1]*1j,
                           zi:zf:self.ActiveDimensions[2]*1j]
         xax = x_dict[self.axis]
         yax = y_dict[self.axis]
-        self['px'] = coords[xax]
-        self['py'] = coords[yax]
+        blank = na.ones( (self.ActiveDimensions[xax],
+                          self.ActiveDimensions[yax]), dtype='float64')
+        self['px'] = coords[xax] * blank
+        self['py'] = coords[yax] * blank
         self['pdx'] = self.dds[xax]
         self['pdy'] = self.dds[yax]
 



More information about the yt-svn mailing list