[yt-svn] commit/yt-3.0: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Jun 3 13:13:21 PDT 2013
2 new commits in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/f2995289fe1a/
Changeset: f2995289fe1a
Branch: yt-3.0
User: samskillman
Date: 2013-06-03 22:11:08
Summary: Quick fix for VR. More work needs to be done to get data source and non-grid
based datasets working nicely.
Affected #: 2 files
diff -r 49f1241d1fd80b4294a520be53e790d1db72fe54 -r f2995289fe1af1a07a7d2d12802410e374f2a873 yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -50,7 +50,7 @@
[ 1, 1, -1], [ 1, 1, 0], [ 1, 1, 1] ])
-def make_vcd(data):
+def make_vcd(data, log=False):
new_field = np.zeros(np.array(data.shape) + 1, dtype='float64')
of = data
new_field[:-1, :-1, :-1] += of
@@ -62,6 +62,8 @@
new_field[1:, 1:, :-1] += of
new_field[1:, 1:, 1:] += of
np.multiply(new_field, 0.125, new_field)
+ if log:
+ new_field = np.log10(new_field)
new_field[:, :, -1] = 2.0*new_field[:, :, -2] - new_field[:, :, -3]
new_field[:, :, 0] = 2.0*new_field[:, :, 1] - new_field[:, :, 2]
@@ -69,6 +71,9 @@
new_field[:, 0, :] = 2.0*new_field[:, 1, :] - new_field[:, 2, :]
new_field[-1, :, :] = 2.0*new_field[-2, :, :] - new_field[-3, :, :]
new_field[0, :, :] = 2.0*new_field[1, :, :] - new_field[2, :, :]
+
+ if log:
+ np.power(10.0, new_field, new_field)
return new_field
class Tree(object):
@@ -269,12 +274,12 @@
dds = self.current_vcds[self.current_saved_grids.index(grid)]
else:
dds = []
- mask = make_vcd(grid.child_mask)
- mask = np.clip(mask, 0.0, 1.0)
- mask[mask<1.0] = np.inf
+ #mask = make_vcd(grid.child_mask)
+ #mask = np.clip(mask, 0.0, 1.0)
+ #mask[mask<1.0] = np.inf
for i,field in enumerate(self.fields):
- vcd = make_vcd(grid[field])
- vcd *= mask
+ vcd = make_vcd(grid[field], log=self.log_fields[i])
+ #vcd *= mask
if self.log_fields[i]: vcd = np.log10(vcd)
dds.append(vcd)
self.current_saved_grids.append(grid)
diff -r 49f1241d1fd80b4294a520be53e790d1db72fe54 -r f2995289fe1af1a07a7d2d12802410e374f2a873 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -185,7 +185,7 @@
transfer_function = ProjectionTransferFunction()
self.transfer_function = transfer_function
self.log_fields = log_fields
- dd = pf.h.all_data()
+ dd = self.pf.h.all_data()
efields = dd._determine_fields(self.fields)
if self.log_fields is None:
self.log_fields = [self.pf._get_field_info(*f).take_log for f in efields]
https://bitbucket.org/yt_analysis/yt-3.0/commits/954d1ffcbf04/
Changeset: 954d1ffcbf04
Branch: yt-3.0
User: MatthewTurk
Date: 2013-06-03 22:13:16
Summary: Merged in samskillman/yt-3.0 (pull request #41)
More VR fixes
Affected #: 2 files
diff -r d540495296df584372b5c2ab42e90b43c6bdf058 -r 954d1ffcbf04c3d1b394c2ea05324d903a9a07cf yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -50,7 +50,7 @@
[ 1, 1, -1], [ 1, 1, 0], [ 1, 1, 1] ])
-def make_vcd(data):
+def make_vcd(data, log=False):
new_field = np.zeros(np.array(data.shape) + 1, dtype='float64')
of = data
new_field[:-1, :-1, :-1] += of
@@ -62,6 +62,8 @@
new_field[1:, 1:, :-1] += of
new_field[1:, 1:, 1:] += of
np.multiply(new_field, 0.125, new_field)
+ if log:
+ new_field = np.log10(new_field)
new_field[:, :, -1] = 2.0*new_field[:, :, -2] - new_field[:, :, -3]
new_field[:, :, 0] = 2.0*new_field[:, :, 1] - new_field[:, :, 2]
@@ -69,6 +71,9 @@
new_field[:, 0, :] = 2.0*new_field[:, 1, :] - new_field[:, 2, :]
new_field[-1, :, :] = 2.0*new_field[-2, :, :] - new_field[-3, :, :]
new_field[0, :, :] = 2.0*new_field[1, :, :] - new_field[2, :, :]
+
+ if log:
+ np.power(10.0, new_field, new_field)
return new_field
class Tree(object):
@@ -269,12 +274,12 @@
dds = self.current_vcds[self.current_saved_grids.index(grid)]
else:
dds = []
- mask = make_vcd(grid.child_mask)
- mask = np.clip(mask, 0.0, 1.0)
- mask[mask<1.0] = np.inf
+ #mask = make_vcd(grid.child_mask)
+ #mask = np.clip(mask, 0.0, 1.0)
+ #mask[mask<1.0] = np.inf
for i,field in enumerate(self.fields):
- vcd = make_vcd(grid[field])
- vcd *= mask
+ vcd = make_vcd(grid[field], log=self.log_fields[i])
+ #vcd *= mask
if self.log_fields[i]: vcd = np.log10(vcd)
dds.append(vcd)
self.current_saved_grids.append(grid)
diff -r d540495296df584372b5c2ab42e90b43c6bdf058 -r 954d1ffcbf04c3d1b394c2ea05324d903a9a07cf yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -185,7 +185,7 @@
transfer_function = ProjectionTransferFunction()
self.transfer_function = transfer_function
self.log_fields = log_fields
- dd = pf.h.all_data()
+ dd = self.pf.h.all_data()
efields = dd._determine_fields(self.fields)
if self.log_fields is None:
self.log_fields = [self.pf._get_field_info(*f).take_log for f in efields]
Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/
--
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