unwrap: Change 1D unwrapper from float to double.

This commit is contained in:
Jostein Bø Fløystad
2013-07-16 13:12:18 +02:00
parent cd5cc84aa9
commit 593a7d63ce
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -6,11 +6,11 @@
from libc.math cimport M_PI
def unwrap_1d(float[::1] image, float[::1] unwrapped_image):
def unwrap_1d(double[::1] image, double[::1] unwrapped_image):
'''Phase unwrapping using the naive approach.'''
cdef:
Py_ssize_t i
float difference
double difference
long periods = 0
unwrapped_image[0] = image[0]
for i in range(1, image.shape[0]):
+2
View File
@@ -90,6 +90,8 @@ def unwrap_phase(image, wrap_around=False):
image_unwrapped = np.empty_like(image, dtype=np.float32, 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')