Phase Unwrapping with SNAPHU

Two-dimensional phase unwrapping is the process of recovering unambiguous phase data from a 2-D array of phase values known only modulo 2pi rad. SNAPHU is an implementation of the Statistical-cost, Network-flow Algorithm for Phase Unwrapping proposed by Chen and Zebker. This algorithm poses phase unwrapping as a maximum a posteriori probability (MAP) estimation problem, the objective of which is to compute the most likely unwrapped solution given the observable input data. Because the statistics relating the input data to the solution depend on the measured quantity, SNAPHU incorporates three built-in statistical models, for topography data, deformation data, and smooth generic data. The posed optimization problem is solved approximately with use of network-flow techniques. As SNAPHU uses an iterative optimization procedure, its execution time depends on the difficulty of the interferogram. The software is written in C and should run on most Unix/Linux platforms.


SNAPHU: Statistical-Cost, Network-Flow Algorithm for Phase Unwrapping

Important note: The installation package for Linux was updated on 12.03.2018 9:05 UTC.
The installation file for version 1.4.2 is provided for 32- and 64-bit Windows OS and Linux OS:

The Windows binaries were built using the MSYS2 environment. For both Windows and Linux, make and gcc packages were necessary. The last step was running the make command on the sources downloaded from here.

Installation and usage instructions:
1. Download the archive provided above and unzip it anywhere (preferably under your home folder)
2. Add the bin subfolder of the extracted folder in the system path.
3. Test your installation by running snaphu in a console. It should print the execution parameters.
4. Export the filtered flattened interferogram from SNAP to SNAPHU (Radar->Interferometric->Unwrapping->Snaphu Export)
5. Step into the output folder, where you should find the snaphu.conf generated file
6. Run SNAPHU from the console using the command which can be found in snaphu.conf (file is in the folder where the wrapped phase was exported) e.g:
snaphu -f snaphu.conf Phase_VV_15Aug2016_27Aug2016.snaphu.img 6238

After the phase is unwrapped it can be imported to SNAP for further analysis using Radar->Interferometric->Unwrapping-> SNAPHU Import.