Sentinel-1 TOPS InSAR Workflow using ISCE2 and Mintpy

This post is a summary of the workflow of Sentinel-1 TOPS InSAR using ISCE2 and MintPy.

1. Installation of ISCE2 and MintPy

This step was done in the previous post. See Installation of ISCE2 and MintPy in Win10 for details.

2. Sentiell-1 TOPS InSAR Workflow

2.1 Data Preparation

2.1.0 Prepare workdir

Prepare workdir for data download and processing.

Source config.rc to export path.

1
2
cd ~/tools/conda-envs/insar
gedit config.rc

To process stackSentinel.pythese following DIR are required []:

  • SLC
  • DEM
  • ORBIT

Use makedir to create these DIRs then export path to ~/tools/conda-envs/insar/config.rc

1
2
3
4
5
6
7
# workdirs
export WORK_DIR=/mnt/c/Users/mengy/Documents/DATA/sentinel
export ORBIT_PATH=${WORK_DIR}/orbits
export AUX_PATH=${WORK_DIR}/AUXFILE
export DEM_PATH=${WORK_DIR}/DEM
export SLC_PATH=${WORK_DIR}/SLC
export INSAR_WORK_DIR=${WORK_DIR}/stacks

2.1.1 Download Sentinel-1 Data

Download data from ASF-search using SSARA.

  • Fill out name and password in ~/tools/utils/SSARA/password_config.py.
  • cd to workdir cd ~/workspace/data/sentinel and run:
1
2
3
ssara_federated_query.py --platform=ENVISAT --relativeOrbit=84 --frame=2943,2961 --start=2010-03-27 --end=2010-05-03 --collection="WInSAR ESA" --print 

ssara_federated_query.py -p SENTINEL-1A,SENTINEL-1B -r 142 -f 106 -s 2024-12-01 -e 2025-04-15 --print

Query result is:

![Query list](query list of ssara sentinel download.png)

If the list is Ok, run same command with --download to download data. In case needed parallel downloading add --parallel=n at the end. ssara_federated_query.py -p SENTINEL-1A,SENTINEL-1B -r 142 -f 106 -s 2024-12-01 -e 2025-04-15 --download --parallel=n. (n is the number of parallel downloading, here we use 5)

2.1.2 Download DEM data

The dem.py from ISCE2 simplifies the process of DEM data download and stitching, but with a bit few arugments.
First make sure that .netrc is set up correctly.

1
2
3
4
echo "machine urs.earthdata.nasa.gov login mengyuchi password 5212109Mengle" > $HOME/.netrc
cd $DEM_PATH
dem.py -a stitch -b 32 35 115 119 -r -s 1 -c
cd ..

![DEM download](downloaded DEM files.png)

2.1.3 Download orbit data

Here we use sentineleof package to download orbit data.

1
2
conda install -c conda-forge sentineleof

Make sure that .netrc is set up correctly.

使用eof下载orbit数据可能需要注册 Copernicus Data SpaceNASA Earthdata

编辑~/.netrc文件:

1
2
3
4
5
6
7
machine dataspace.copernicus.eu    
login mengyuchile@163.com
password 5212109@MENGle

machine urs.earthdata.nasa.gov
login mengyuchile
password 5212109Mengle

然后运行:

1
eof -p $SLC_PATH --save-dir $ORBIT_PATH

-p $SLC_PATH specifies the directory where the SLC files are located. --save-dir $ORBIT_PATH specifies the directory where the orbit files will be saved. Then sentineleof will download the orbit files for each SLC file in the specified directory.

3. Acquisition InSAR interferograms using stackSentinel.py

stackSentinel.py is not a one-click command, its function is to read the parameters you provide, generate the corresponding runfile executable file, and the associated configuration parameter information. Only after running stackSentinel.py and obtaining the runfile do we officially begin the interferometric operations. Here are the parameters I used for the run:

1
stackSentinel.py -s $SLC_PATH -w $INSAR_WORK_DIR -a $AUX_PATH -d $DEM_PATH/demLat_N32_N35_Lon_E115_E119.dem.wgs84 -o $ORBIT_PATH -n 3 -b '34.00 34.60 116.50 117.95' --useGPU -C geometry -c 3 -z 1 -r 6 -f 0.6 
  • -s $SLC_PATH: Specifies the directory where the SLC files are located.
  • -w $WORK_DIR: Specifies the directory where the work files will be saved.
  • -a $AUX_PATH: Specifies the directory where the auxiliary files are located.
  • -d $DEM_PATH/demLat_N32_N35_Lon_E115_E119.dem.wgs84: Specifies the path to the DEM file.
  • -o $ORBIT_PATH: Specifies the directory where the orbit files are located.
  • -n 3: A list of swaths to be processed. Specifies the IW subswaths sequence number. The optional parameters are 1, 2, or 3. After selecting the corresponding IW strip, only your specified IW strip will be extracted. If your study area is small, this parameter can significantly save storage space for you. (Default : ‘1 2 3’).
  • -b '34.00 34.60 116.50 117.95': Specifies the bounding box of the area of interest. Pay attention that this command does not clip the SLC files, but only extract at least 3 burst of SLC files within the specified area. (Notice!! The order of the coordinates are SNWE, in other words: lat_min lat_max lon_min lon_max)
  • --useGPU: Allow App to use GPU when available.
  • -C geometry: Specifies the configuration file. Has two options: geometry and NESD, NESD refines geometric registration based on burst overlap areas. Selecting NESD will significantly increase both processing time and storage requirements. While theoretically this should improve alignment quality (though in my personal case, I didn’t observe substantial improvement).
  • -c 3: Specifies number of interferograms between each date and subsequent dates (default: 1).
  • -z 1: Specifies number of looks in azimuth for interferogram multi-looking (default: 3).
  • -r 3: Specifies number of looks in range for interferogram multi-looking (default: 9).
  • -f 0.6: Specifies the filter strength for interferogram filtering (default: 0.5)…
  • --num_proc 2: Specifies number of tasks running in parallel in each run file (default: 1).
  • param_ion: Ionosphere estimation parameter file. if provided, will do ionosphere estimation.

More of the parameter can be found through stackSentinel.py --help.

After running stackSentinel.py, the script will generate a runfile executable file in folder run_files and a configuration parameter information file in folder configs under $WORK_DIR. The runfile executable file is used to run the interferometric operations, and the configuration parameter information file is used to configure the interferometric operations.

![runfile folder](run_files folder.png)

Only by executing all files in the run_file do we formally initiate interferogram generation. This process is highly resource-intensive, consuming substantial memory and time.

1
2
cd $INSAR_WORK_DIR/run_files
bash run_01_unpack_topo_reference

This process is also possible using python script.

1
2
3
4
import os
os.system(directory+'/run_01_unpack_topo_reference')
print('run_01_unpack_topo_reference complete.')

Attention: During this process run_01, run_04, run_05, run_07,run_08, run_10, run_11 are time-consuming, and the memory usage is high.

All results are saved in $WORK_PATH, where you can monitor them in real time. Once all run_files have been executed, the desired results are located in the merged folder. Specifically:

geom_reference : This folder contains files that document the transformation between radar coordinates and Earth-centered coordinate systems. These files are essential for subsequent geographical encoding tasks.
interferograms : This folder contains the interferometric results for each date, including:
.unw: Unwrapped phase results
filt_fine.int: Filtered interferogram
fine.int: Original interferogram
.cor: Coherence results

Notice: All .vrt, .xml and .meta files generated by ISCE are visible using mdx.py script.

1
2
3
cd $WORK_PATH/merged/interferograms/20200820_20200925
mdx.py filt_fine.int

4. Full ISCE2 workflow

  • Download Sentinel data
1
2
3
load_insar
cd $SLC_PATH
ssara_federated_query.py -p SENTINEL-1A,SENTINEL-1B -r 142 -f 106 -s 2024-12-01 -e 2025-01-10 --download --parallel=2
  • Download DEM
1
2
cd $DEM_PATH
dem.py -a stitch -b 32 35 115 119 -r -s 1 -c
  • Download orbit data
1
eof -p $SLC_PATH --save-dir $ORBIT_PATH
  • Run stackSentinel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
stackSentinel.py -s $SLC_PATH -w $INSAR_WORK_DIR -a $AUX_PATH -d $DEM_PATH/demLat_N32_N35_Lon_E115_E119.dem.wgs84 -o $ORBIT_PATH -n 3 -b '34.00 34.60 116.50 117.95' --useGPU -C geometry -c 3 -z 1 -r 6 -f 0.6 --num_proc 4
cd $INSAR_WORK_DIR/run_files
bash run_01_unpack_topo_reference
bash run_02_unpack_secondary_slc
bash run_03_average_baseline
bash run_04_fullBurst_geo2rdr
bash run_05_fullBurst_resample
bash run_06_extract_stack_valid_region
bash run_07_merge_reference_secondary_slc
bash run_08_generate_burst_igram
bash run_09_merge_burst_igram
bash run_10_filter_coherence
bash run_11_unwrap

5. Errors occured during Porcessing

* run_11_unwrap: Out of Memory

This error happens when runing run_11_unwrap in run_files folder. The error message is: ‘Initializing flows with MCF algorithm. Out of memory’.

This error is caused by the memory of the GPU is not enough allocated to WSL.

  • 1st solution is to increase the memory of WSL123.

    *1. Open folder C:\Users\mengy and create a file named .wslconfig

    *2. Copy these lines to the file

    1
    2
    3
    4
    5
    # Settings apply across all Linux distros running on WSL 2
    [wsl2]

    # Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
    memory=12GB

    *3. Restart WSL

    1
    wsl --shutdown

    *4. Validation

    Run this command in WSL.

    1
    2
    free -h  # check GPU usage
    nproc # check core usage
  • 2nd solution is to reduce the number of looks in azimuth and range. Not validated.

* run_01_unpack_topo_reference: IndexError

This error happens when runing run_01_unpack_topo_reference in run_files folder. The error message is: ‘IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed’.

Solution: The error is caused by worng order of coordinates. The order of the coordinates is SNWE, in other words: lat_min lat_max lon_min lon_max.

References

  1. CSDN blog

Sentinel-1 TOPS InSAR Workflow using ISCE2 and Mintpy
https://mengyuchi.gitlab.io/2025/04/16/Sentinel-1-TOPS-InSAR-Workflow-using-ISCE2-and-Mintpy/
Author
Yuchi Meng
Posted on
April 16, 2025
Licensed under