From b2ac1a587265e9fec53aa96fe1ce9dfeadd2cf9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Mon, 15 Jul 2013 18:33:26 +0200 Subject: [PATCH] unwrap: Add docstring example. --- skimage/exposure/unwrap.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/skimage/exposure/unwrap.py b/skimage/exposure/unwrap.py index c43e263d..a38162bd 100644 --- a/skimage/exposure/unwrap.py +++ b/skimage/exposure/unwrap.py @@ -29,6 +29,15 @@ def unwrap_phase(image, wrap_around=False): Unwrapped image of the same shape as the input. If the input ``image`` was a masked array, the mask will be preserved. + Examples + -------- + >>> c0, c1 = np.ogrid[-1:1:128j, -1:1:128j] + >>> image = 12 * np.pi * np.exp(-(c0**2 + c1**2)) + >>> image_wrapped = np.angle(np.exp(1j * image)) + >>> image_unwrapped = unwrap_phase(image_wrapped) + >>> np.std(image_unwrapped - image) < 1e-6 # A constant offset is normal + True + References ---------- .. [1] Miguel Arevallilo Herraez, David R. Burton, Michael J. Lalor,