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 esa-snap_sentinel_unix_6_0.sh
  • 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 (DM)
    • Image Processing Toolbox (IP)
    • Signal Processing Toolbox (SG)
    • Statistics and Machine Learning Toolbox (ST)
  • 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 https://github.com/mdelgadoblasco/snap2stamps.git
  • 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.

Configuration

  • 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"
...
export MATLABPATH=$STAMPS/matlab:`echo $MATLABPATH`
...
# 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"
...
export PATH=${PATH}:$STAMPS/bin:$MATLABPATH:$SNAP2STAMPS/bin
  • 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!

Regards,
Matthias

About This Author

Matthias studied Environmental Information Management at the University of Natural Resources and Life Sciences Vienna and holds a PhD in environmental statistics. The focus of his thesis was on the statistical modelling of rare (extreme) events as a basis for vulnerability assessment of critical infrastructure. He is working at the Austrian national weather and geophysical service (ZAMG) and at the Institute of Mountain Risk Engineering at BOKU University. He currently focuses the (statistical) assessment of adverse weather events and natural hazards, and disaster risk reduction. His main interests are statistical modelling of environmental phenomena as well as open source tools for data science, geoinformation and remote sensing.

9 Comments

You can post comments in this post.


  • Hi Matthias,
    Very interesting, and thank you for this valuable info and steps
    I’m a quite new user to PSI method with StaMPS.

    looking forward to your next post.

    Best regards,
    Nureldin

    Nureldin 9 months ago Reply


  • Thank you for your detailed description.
    I would also ask you if built-in Matlab function are enough to use StaMPS or are also needed some Matlab toolboxes (in particular the Signal Processing toolbox)

    GianniC 8 months ago Reply


    • Hi,

      while a dependency report on the full GitHub repo lists multiple toolboxes (Mapping, Image Processing, Optimization, Processing, Statistics and Machine Learning), you only need two toolboxes: (1) the Signal Processing Toolbox and (2) the Statistics & ML Toolbox. I guess that the latter one can be circumvented by making some adjustments to the code, but I haven’t had time to look into it yet.

      Matthias 4 months ago Reply


  • Hi, is it possible to run StaMPS installing Matlab runtime?

    David LWD 7 months ago Reply


    • I guess that’s (at least currently) not possible. StaMPS only allows for a semi-automated workflow, imho. Several things have to be adjusted manually throughout the whole processing chain.

      Matthias 4 months ago Reply


  • Hi Matthias,
    Which MATLAB version is suitable for STaMPS 4.1b1?

    Mohammad Shoab 2 months ago Reply


    • Hi,

      StaMPS 4.1b1 was released in August, 2018. We’re using R2018b, but I guess some slightly older versions should work as well, but I haven’t tested that.

      Regards,
      Matthias

      Matthias 3 weeks ago Reply


  • Hi Matthias,
    I want to ask whether STAMPS can run on windows?
    Looking forward to your reply.

    PUDDIN 2 weeks ago Reply


    • Hi,

      you could try to run it through Cygwin, but I would strongly advise to use Linux. StaMPS causes enough headache as is, and I guess this will only be aggravated as you have to fix all kinds of Windows incompatibility issues as well. Trying a live distro or using a dualboot system is really simple, so I would recommend that. However. if you really want to try it, you might want to have a look at the StaMPS Category on the STEP Forum: https://forum.step.esa.int/t/about-the-stamps-category/8140

      Regards,
      Matthias

      Matthias 21 hours ago Reply


Post A Reply

*