Using StaMPS/MTI for PSI Analysis – Part 1: Installation and Setup

Dear all,

I am currently involved in several projects that rely on Persistent Scatterer Interferometry (PSI), a radar-based technique that belongs to the group of differential interferometric Synthetic Aperture Radar (SAR).

Specifically, I am using StaMPS/MTI to analyse Sentinel-1 SLC data. StaMPS/MTI written in Matlab and C++. Currently, this seems to be the most cost-efficient software to perform PSI software, since commercial software (e.g. GAMMA or SARScape) is quite expensive. Even though a Matlab-license is required, StaMPS code is more or less open source (that is, apart from built-in Matlab-functions).

Having mainly worked with optical data and R / Python / QGIS before, it took me some time to get everything running as intended, especially since the documentation is rather rudimentary, at least if one is starting to explore this topic. I therefore decided to document all relevant steps in a series of posts, starting with the very basics: installation and setup instructions.

This documentation is intended to provide guidance on how to setup StaMPS for the first time and is based on the excellent SNAP-StaMPS Workflow compiled by Thorsten Höser as well as discussions from MAINSAR, the step forum on snap-stamps workflow and the stamps-tool as well as Ask Ubuntu. Acknowledgements and thanks to all people contributing to these discussions.

Please note that this summary has been written and tested on a certain machine using a specific user. Even though I tried to generalize code as much as possible, certain paths may have to be adjusted accordingly.

Theoretical Background on PSI

Guidance given in this summary is purely technical. However, it is absolutely necessary to know the basics of the theoretical background of radar remote sensing and InSAR, otherwise the whole adventure of StaMPS PSI analysis is doomed to fail, since you will be lost given the large number of parameter settings. Based on Thorstens’ recommendations, I have compiled a list of potentially helpful sources:

Software Setup

  • Install a Linux distribution of your choice. Since I am a happy Ubuntu user since quite some time, this instruction refers to Ubuntu 18.04 LTS (with vanilla GNOME). Commands below should work on any Debian-based distro, though. If you are using another distribution, some commands have to be adjusted accordingly.
  • Install SNAP (direct download link): bash
  • Install StaMPS (direct ownload link): Download and unzip. Inside the directory: make and subsequently make install
  • Install SNAPHU
sudo apt-get update
sudo apt-get install snaphu
sudo apt-get install triangle-bin
  • Install MATLAB for Linux. Things may go haywire here. Note that this may cause some trouble with respect to version incompatibilities of system libraries and libraries contained in the MALAB-installation (e.g. libstdc++6, gcc-4.9). Possible fixes may be found e.g. on the MathWorks forum or AskUbuntu. Note that you need the following toolboxes:
    • Parallel Computing Toolbox (distrib_computing_toolbox)
    • Image Processing Toolbox (image_toolbox)
    • Signal Processing Toolbox (signal_toolbox)
    • Statistics and Machine Learning Toolbox (statistics_toolbox)
  • Install dependencies – these include GNU awk, the tcsh unix shell, the matlab support package (Ubuntu-specific), the build-management-tool, and the C++ compiler:
sudo apt-get install gawk
sudo apt-get install tcsh
sudo apt-get install matlab-support
sudo apt-get make
sudo apt-get build-essential g++
git clone
  • If you intend to include tropospheric correction methods into the InSAR processing chain, install the Toolbox for Reducing Atmospheric InSAR Noise (TRAIN). This is optional, but will increase the accuracy of your results. TRAIN can be used in StaMPS (step 8) to remove tropospheric delays. Note that TRAIN does have additional dependencies (see manual for full description), such as e.g.:
    • BEAM for re-projection of satellite data;
    • NCL when using weather model data from the US;
    • GMT for auxiliary tropospheric correction methods

These are the basic installation steps and software requirements. Let’s move on to editing some config-files.


  • Edit the StaMPS config file (e.g. via vim ./StaMPS/StaMPS_CONFIG.bash – or wherever your StaMPS installation is located) to contain the correct paths to StAMPS, snap2stamps, SNAPHU. Note that this is jus a generic example, you have to adjust the paths accordingly:
# set environment variables:
export STAMPS="/home/username/StaMPS"
export SNAP2STAMPS="/home/username/snap2stamps"
#if triangle and snaphu are not installed through the repositories (i.e. compiled locally):
export TRIANGLE_BIN="/home/username/software/triangle/bin"
export SNAPHU_BIN="/home/username/software/snaphu/bin"
# use points not commas for decimals, and give dates in US english
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
  • source the StaMPS config file upon opening a terminal by adding it to your .bashrc:
# source StaMPS
source /home/username/StaMPS/StaMPS_CONFIG.bash

That’s about it for now. In my next post I will outline a general workflow of S1 SLC data pre-processing using SNAP and snap2stamps. Stay tuned for further updates!


About This Author

Matthias studied Environmental Information Management at the University of Natural Resources and Life Sciences, Vienna. He is currently a PhD student in environmental statistics, working at ZAMG, the Austrian national weather and geophysical service. He currently focuses the (statistical) assessment of adverse weather events and natural hazards, and disaster risk reduction. His main interests are open source tools for data science, geoinformation and remote sensing

Post A Reply