unwrap: Simplify code after completing float->double.

This commit is contained in:
Jostein Bø Fløystad
2013-07-16 13:13:59 +02:00
parent 593a7d63ce
commit 8ad3d1df17
+2 -8
View File
@@ -86,21 +86,15 @@ def unwrap_phase(image, wrap_around=False):
mask = np.require(image.mask, np.uint8, ['C'])
else:
mask = np.zeros_like(image, dtype=np.uint8, order='C')
image_not_masked = np.asarray(image, dtype=np.float32, order='C')
image_unwrapped = np.empty_like(image, dtype=np.float32, order='C')
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
if image.ndim == 1:
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
unwrap_1d(image_not_masked, image_unwrapped)
elif image.ndim == 2:
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
unwrap_2d(image_not_masked, mask, image_unwrapped,
wrap_around)
elif image.ndim == 3:
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
unwrap_3d(image_not_masked, mask, image_unwrapped,
wrap_around)