Skip to main content

2D and 3D phase unwrapping

Project description

This is a Python wrapper for 2D and 3D phase unwrapping code based on:

More information about the code can be found on GERI homepage: 2D, 3D. The general principle and applications are the same as those for a 1D unwrap available in numpy.

Usage

The package is based on cffi and requires it for installation:

$ pip install cffi
$ pip install unwrap

The interface consists of a single function:

>>> from unwrap import unwrap
>>> unwrapped_array = unwrap(
...    wrapped_array,
...    wrap_around_axis_0=False,
...    wrap_around_axis_1=False,
...    wrap_around_axis_2=False)

It takes a 2- or 3-dimensional numpy array of floats, wrapped_array, and returns an array with the same shape with the values changed by integer multiples of 2 pi such that the whole array has the least amount of jumps.

wrapped_array can be a masked array, in this case masked entries are ignored during the phase unwrapping process. This is useful if the wrapped phase data has holes or contains invalid entries.

If the optional arguments wrap_around_axis_0 etc. are set to True, then phase unwrapping takes place also across the boundaries of the specified axis, i.e., the first and last pixel along this axis are assumed to be neighbours.

Internally the wrapped array is converted to a C-contiguous array of np.float32, therefor the unwrapped array also has this data type.

Usage examples can be found in test/test_unwrap.py.

People

The original C code by the authors mentioned above has been slightly modified by Gregor Thalhammer for using it as a library. Bogdan Opanchuk changed the Python wrapper to use cffi instead of Cython and improved packaging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unwrap-0.1.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

unwrap-0.1.0.win32-py2.7.exe (234.7 kB view details)

Uploaded Source

File details

Details for the file unwrap-0.1.0.tar.gz.

File metadata

  • Download URL: unwrap-0.1.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for unwrap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aac85c320474581452915852aa0b3a5600069a03dacd3b1065fe4becf7b492cc
MD5 a9a1ad7e1c911f16d12fac9a47ca5fae
BLAKE2b-256 8ebce8f5d1a7a6f74041590774dd1bdc1af93c88c4145a9fe5acaf152b41dc28

See more details on using hashes here.

File details

Details for the file unwrap-0.1.0.win32-py2.7.exe.

File metadata

File hashes

Hashes for unwrap-0.1.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 7cecd38b8f94e03fc8bbc7f6cc41e64c55f29d9ebc1930c50505f0446c6fb870
MD5 5d4aae3563ee35c7467dec899071bd40
BLAKE2b-256 2c7a9e42c8b793e94f8f96639bb86332d952f0cb047a313964b850088bf630d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page