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
SNAPHU plugin for SNAP
Installation and usage instructions:
- This plugin is now available under SNAP plugins. The SNAPHU Unwrapping plugin can be installed from Tools->Plugins->Available Plugins.
- Choose the plugin, click “Install” and follow the installation procedure. Restart SNAP when SNAPHU Unwrapping installation is finished.
- Once installed the plugin will be available under Radar->Interferometric->Unwrapping->Snaphu-unwrapping *
- Before unwrapping a product has to be exported using Snaphu Export (Radar->Interferometric->Unwrapping->Snaphu Export)
- When the export is done the Snaphu Unwrapping can be executed (Radar->Interferometric->Unwrapping->Snaphu-unwrapping).
- On the first tab, select the product previously exported with Snaphu Export (e.g. Phase.hdr). On the parameters tab select the output folder. In order to be able to open the unwrapped product, it is mandatory to select as an output folder the same folder where your exported files (e.g. phase.img, snaphu.conf etc.) are located. You can also check “Display execution output” in order to be able to view the log and the unwrapping execution progress. Then click “Run”.
- After the phase is unwrapped it can be imported to SNAP for further analysis using Radar->Interferometric->Unwrapping-> SNAPHU Import (for using the unwrapped output product in SNAPHU Import, make sure to previously save it).
* When running SNAPHU Unwrapping tool for the first time the user will be noticed about the need to set up working path for the plugin. Click OK and proceed with bundle download/installation. After these steps the plugin will be ready use. On Linux, after the plugin installation, make sure to add the execute permission on snaphu script under $HOME/.snap/auxdata/snaphu-v1.4.2_linux/bin before starting to use the plugin.
Manual SNAPHU installation
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:
- Installation file for 64-bit Windows: snaphu-snaphu-v1.4.2_win64.zip
- Installation file for 32-bit Windows: snaphu-v1.4.2_win32.zip
- Installation file for Linux: snaphu-v1.4.2_linux.zip
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.