StaMPS-InSAR research based on ENVISAT using LiDO3
Intro
This post is about working steps of StaMPS-InSAR using 13 ENVISAT images in LiDO3.
StamPS-InSAR
StaMPS (Stanford Method for Persistent Scatterers) is a software package that implements an InSAR persistent scatterer (PS) method developed to work even in terrains devoid of man-made structures and/or undergoing non-steady deformation. StaMPS/MTI (Multi-Temporal InSAR) is an extended version of StaMPS that also includes a small baseline method and a combined multi-temporal InSAR method. The original development of StaMPS was undertaken at Stanford University, but subsequent development of StaMPS and StaMPS/MTI has taken place at the University of Iceland, Delft University of Technology, and the University of Leeds. There are also contributions from users of the package based at other institutions1.
StaMPS PS analysis is performed within MATLAB, using the main function stamps(), which takes the first and last StaMPS-step as main arguments. To run StaMPS complete with default arguments, use stamps(1,8)2.
Train
The Toolbox for Reducing Atmospheric InSAR Noise - TRAIN - is developed in an effort to include current state of the art tropospheric correction methods into the default InSAR processing chain. Initial development was performed at the University of Leeds. The toolbox consists of a combination of command line scripts, shell scripts, and matlab scripts. More information on software is provided in Chapter 3. TRAIN is independent of the used InSAR processor, as long as the data convention is followed. The toolbox is compatible with the StaMPS software. Further initial efforts have been put to include TRAIN into the default -rate processing chain3.
Configuration
-
edit the StaMPS config file (e.g. via vim ./StaMPS/StaMPS_CONFIG.bash) to contain the correct paths to StAMPS, SNAPHU and triangle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17# 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 SAR_TAPE="/dev/rmt/0mn"
...
export PATH=${PATH}:$STAMPS/bin:$MATLABPATH:$SNAP2STAMPS/bin -
source the StaMPS config file upon opening terminal by adding it to your .bashrc
1
2# source StaMPS
source /home/username/StaMPS/StaMPS_CONFIG.bash -
do the same thing for your TRAIN (APS_toolbox) config file
- adjust path in the APS_CONFIG file
1
export APS_toolbox="/home/username/TRAIN"
-source it upon opening a terminal
1
2# add TRAIN config
source /home/username/TRAIN/APS_CONFIG.sh -
install dependencies
gwak and tsch was already installed in LiDO3, thank god!
Process
Pre-stamps
In Stamps official tutorial there is ‘INSAR_master_date’ folder, after search answers in STEP forum, we found the perfect resolution,
I am about to start my step 4- PS processing the ‘PSI’ folder which i obtained from stamps export in windows environment has four folders in it ‘dem’, ‘diff0’, ‘geo’ and ‘rslc’. The following are my queries:
Can i proceed or should i rename any of the folders to proceed? In which path should i place this PSI folder?
-
Answer4
1-move the ‘PSI’ folder to your Linux directory,
2- use the shell to create a new folder, (LINUX)
mkdir ~/INSAR_master_date
3- copy the folder ‘PSI’ into this folder ‘INSAR_master_date’
cp -/PSI -/INSAR_master_date
Now you’re ready to start as explained in the previous post.
Pre-Matlab Processing
1 |
|
Working in LiDO3 with ThinLinc Client
cd /work/smyumeng/ENCISAT_project
1 |
|
Matlab
1 |
|
Step 1: Load Data
Converts the data into the formats required for PS processing and stores them in matlab workspaces.
1 |
|
Step 2: Estimate phase noise
This is an iterative step that estimates the phase noise value for each candidate pixel in every interferogram.
Error in step2
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Error in ps_est_gamma_quick (line 236) ph_grid(grid_ij(i,1),grid_ij(i,2),:)=ph_grid(grid_ij(i,1),grid_ij(i,2),:)+shiftdim(ph_weight(i,:),-1);
Error in stamps (line 326)
ps_est_gamma_quick(est_gamma_parm);
Solution:
You may try with this function I have modified time ago. I hope it works for you. [ps_load_initial_gamma.m](https://forum.step.esa.int/uploads/default/original/2X/6/66b076f51da0e68543126e37dccc38937f5806d6.m). It should be used on the stamps step 1. So before you override the current one on the stamps_v4.1b/matlab/ please make a backup. Then please run again the command stamps(1,1) so you re-run step1 to use this function Let me know if this helps[5].
1 |
|
Step 3: PS selection
Pixels are selected on the basis of their noise characteristics. This step also estimates the percentage of random (non-PS) pixels in a scene from which the density per km2 can be obtained.
Processing is controlled by the following parameters:
1 |
|
Step 4:
No Aavailable PS points in every batch (1-6), still finding solution. If can not solve, then qiut ENVISAT PS processing in LiDO3.
Update: After setting clap_beta
to 0.6, batch_3 resulted 6006 PS selected initally, so we reset parameter and redo stamps(1,5)
1 |
|
Step5-8
Matlab plot
After stamps(1,8), we copy the file folder /work/smyumeng/ENVISAT_PS/ (except subfolder /INSAR_20070602) to windows H:\StaMPS_result\ENVISAT_PS_1 using WinSCP for further processing.
To equalize the source .bash command in Windows, we use addpath in matlab.
1 |
|
Error 1
1 |
|
Solution
Install all matlab toolbox!
Slurm
This section is about test run for slurm to control batch jobs and cluster resources6.
Queue | max. wlltime | remake |
---|---|---|
short | 02:00:00 | / |
med | 08:00:00 | / |
long | 2-00:00:00 | / |
ultralong | 28-00:00:00 | no GPU or “non-bolcking” nodes |
testpart | 02:00:00 | use when instructed by LiDO3 administrators |
1 |
|
1 |
|
1 |
|
SBATCH to run jobs
Script dir: /work/smyumeng/project/script
- Create script to atuo run stamps jobs in LiDO.
1 |
|
- Edit stamps_testrun.sh
1 |
|
Error:
1
2
3
4
5
6
7
8
9
10STAMPS: Will process current directory only
STAMPS: ########################################
STAMPS: ################ Step 1 ################
STAMPS: ########################################
STAMPS: Directory is scripts
PS_LOAD_INITIAL: Starting
PS_LOAD_INITIAL: Loading data into matlab...
{Error using load
Unable to read file '../day.1.in'. No such file or directory.
Solution:
1missset the working dir in matlab command
1
2
module add matlab
srun matlab -nodisplay -nosplash -r 'cd /work/smyumeng/ENVISAT_project;stamps(1,5);quit