[python-dtcwt] 105/497: update 3d directionality example to discard level 1 highpass

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:05:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit 954daebbf437798ad557a89ed386ee84ca194c1d
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Fri Aug 9 18:29:33 2013 +0100

    update 3d directionality example to discard level 1 highpass
---
 examples/3d_dtcwt_directionality.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/3d_dtcwt_directionality.py b/examples/3d_dtcwt_directionality.py
index cdc825b..7142f8e 100644
--- a/examples/3d_dtcwt_directionality.py
+++ b/examples/3d_dtcwt_directionality.py
@@ -20,21 +20,22 @@ from dtcwt import dtwavexfm3, dtwaveifm3, biort, qshift
 
 # Specify details about sphere and grid size
 GRID_SIZE = 128
-SPHERE_RAD = 0.33 * GRID_SIZE
+SPHERE_RAD = int(0.45 * GRID_SIZE) + 0.5
 
 # Compute an image of the sphere
 grid = np.arange(-(GRID_SIZE>>1), GRID_SIZE>>1)
 X, Y, Z = np.meshgrid(grid, grid, grid)
 r = np.sqrt(X*X + Y*Y + Z*Z)
-sphere = 0.5 + np.clip(SPHERE_RAD-r, -0.5, 0.5)
+sphere = (0.5 + np.clip(SPHERE_RAD-r, -0.5, 0.5)).astype(np.float32)
 
 # Specify number of levels and wavelet family to use
 nlevels = 2
 b = biort('near_sym_a')
 q = qshift('qshift_a')
 
-# Form the DT-CWT of the sphere
-Yl, Yh = dtwavexfm3(sphere, nlevels, b, q)
+# Form the DT-CWT of the sphere. We use discard_level_1 since we're
+# uninterested in the inverse transform and this saves us some memory.
+Yl, Yh = dtwavexfm3(sphere, nlevels, b, q, discard_level_1=True)
 
 # Plot maxima
 figure(figsize=(8,8))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list