unwrap: moved global variables (wrap_around) to params struct

This commit is contained in:
Gregor Thalhammer
2013-11-22 10:42:27 +01:00
committed by Jostein Bø Fløystad
parent a660ccc727
commit 6f40c95c08
2 changed files with 724 additions and 703 deletions
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -6,17 +6,17 @@ from numpy import outer, arange, ones, abs, empty, power, indices
def test_unwrap2D():
nx, ny = 64, 64
nx, ny = 10, 3
x = np.arange(nx)
y = np.arange(ny)
x.shape = (1,-1)
y.shape = (-1,1)
z = np.exp(1j*x*0.5) * np.exp(1j*y*0.1)
z = np.exp(1j*x*0.2*np.pi) * np.exp(1j*y*0.1*np.pi)
phi_w = np.angle(z)
mask = 255*np.ones((nx, ny), dtype = np.uint8)
phi = unwrap2D(phi_w.astype(np.float32), mask)
return phi_w, phi
return phi_w/(np.pi*2), np.asarray(phi)/(np.pi*2)
# class test_unwrap(TestCase):
@@ -44,4 +44,7 @@ def test_unwrap2D():
if __name__=="__main__":
#NumpyTest().run()
import matplotlib.pyplot as plt
p,p2 = test_unwrap2D()
plt.imshow(p2)
plt