Background
In order to perform differential interferometry on Sentinel-1 data using the GMT5SAR software package, Alaska Satellite Facility (ASF) provides the python script procS1GMTSAR.py. This script takes two Sentinel-1 IW SLC files and creates a differential interferogram of the data in both GeoTIFF and KMZ format. The user may specify an input DEM file (which must be in GMT GRD format) or a DEM file will automatically be downloaded for the user via the opentopo service. The script creates an interferogram for the main polarization, VV, only.
The Sentinel-1 granules must be in the directory where the script is run, i.e. the .zip files must be in the directory where you run the script. In addition, the ASF provided GMT5SAR configuration file, config.s1a.txt, must be in the same location as your executable file procS1GMT5SAR.py.
Access ASF’s python script and configuration file.
Prerequisites
Materials List:
- Ubuntu Server 16.04
- At least 200 GB of free space
- Python 2.7 (2.7.12-1ubuntu0~16.04.1)
- Python-requests (2.9.1-3)
- GDAL (gdal-bin (2.1.3+dfsg-1~xenial2)
- GMT (5.2.1+dfsg-4ubuntu2~xenial2)
- GMT5SAR v.3
- ASF config file: config.s1a.txt
- ASF script: procS1GMT5SAR.py
- Orbit directories (state vectors)
- Sample Granules (Two Sentinel-1 SLCs, IW, VV only)
- S1A_IW_SLC__1SSV_20150526T014935_20150526T015002_006086_007E23_679A.zip
- S1A_IW_SLC__1SDV_20150607T014936_20150607T015003_006261_00832E_3626.zip
Steps
Preparing the GMT5SAR system
Starting with a clean installation of Ubuntu Server 16.04 that has at least 200 GB of free space for data files and the finished product.
Install Software
1. Install python, lxml, and requests:
sudo apt-get update
sudo apt-get install python2.7
sudo apt-get install python-lxml
sudo apt-get install python-requests
2. Install GDAL:
sudo add-apt-repository -y ppa:ubuntugis/ppa
Note: If this first command does not work, you may be using a new version of Ubuntu and the stable GDAL version may not be compatible. To install the latest experimental version of GDAL, follow these commands:
sudo add-apt-repository -r ppa:ubuntugis/ppa
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
Experimental versions of GDAL may not behave as expected and may potentially cause other issues with this recipe.
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev python-gdal
3. Install GMT:
sudo apt-get install csh subversion autoconf libtiff5-dev libhdf5-dev
sudo apt-get install ghostscript
sudo apt-get install libfftw3-dev
sudo apt-get install libgmt-dev
sudo apt-get install gmt
4. Download and install the orbit directories:
cd ~
wget
https://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
cd /usr/local
sudo mkdir orbits
cd orbits
sudo tar -xf ~/ORBITS.tar
5. Download, compile and install GMT5SAR:
cd /usr/local
sudo svn checkout svn://gmtserver.soest.hawaii.edu/GMT5SAR/branches/5.4GMT5SAR
cd GMT5SAR
sudo apt-get install gfortran
sudo autoconf
sudo ./configure -–with-orbits-dir=/usr/local/orbits
sudo make
sudo make install
Once you have completed the installation steps given above, you are ready to configure.
Version numbers of the packages installed in the creation of this data recipe:
python2.7 (2.7.12-1ubuntu0~16.04.1)
python-lxml (3.5.0-1build1)
python-requests (2.9.1-3)
gdal-bin (2.1.3+dfsg-1~xenial2)
libgdal-dev (2.1.3+dfsg-1~xenial2)
python-gdal (2.1.3+dfsg-1~xenial2)
csh (20110502-2.1ubuntu1)
subversion (1.9.3-2ubuntu1.1)
autoconf (2.69-9)
ghostscript (9.18~dfsg~0-0ubuntu2.7)
libfftw3-dev:amd64 (3.3.4-2ubuntu1)
libgmt-dev (5.2.1+dfsg-4ubuntu2~xenial2)
gmt (5.2.1+dfsg-4ubuntu2~xenial2)
Configure
Prior to running the ASF script, each user will need to perform these configuration steps:
1. Make GMT5SAR executables locatable:
export PATH=$PATH:/usr/local/GMT5SAR/bin/
Note: You must export the new path every time you log in (or set it in your profile).
Download script and config file:
2. Download config.s1a.txt from ASF’s Data Recipe zip button and place it in your home directory.
- The config file is set up to process interferometry only (threshold_snaphu=0.0)
- For unwrapping, edit the config file in a text editor, set threshold_snaphu=0.2
3. Download procS1GMT5SAR.py
from ASF’s Data Recipe zip button and place it in your home directory.
Create a .netrc file:
In order to get the precision state vectors from ASF, you must create a .netrc file in your home directory. This file must contain the following information. (Use the username and password from your URS/Earthdata account. Same as used to log in to Vertex):
Use a text editor such as “vi” to create or edit the .netrc file:
cd ~
vi .netrc
Add these lines:
machine urs.earthdata.nasa.gov
login <username>
password <password>
You are finally ready to create an interferogram.
Run the Script — Create an Interferogram
1. Issue the following command to run the GMT5SAR process:
python procS1GMT5SAR.py <master granulename> <paired granulename>
Notes:
- Use two Sentinel-1 SLCs, VV polarization only
- The master granule must be first
- Use .zip or .SAFE files
- Script options:
- -h, – -help shows help message and exits
- -d DEM, – -dem <yourDEMfilename> User-specified DEM file (in GMT format). If not used, the script will pull a DEM for you.
Example:
python procS1GMT5SAR.py
S1A_IW_SLC__1SSV_20150526T014935_20150526T015002_006086_007E23_679A.zip
S1A_IW_SLC__1SDV_20150607T014936_20150607T015003_006261_00832E_3626.zip
The script will take some time to complete. The three commands prefaced with “Running Interferogram: “takes the bulk of processing time. Expect to wait a significant amount of time for each of the calls to p2p_S1A_TOPS.csh to finish (as much as an hour per call).