StaMPS 4.1 beta Installation in Ubuntu 18.04

Hi ABraun,

I have changed the path varaibles.

How could I confirm that StaMPS is Installed ?

if you now enter

  • mt_prep_snap you should get a description of the algorithm
  • snaphu you should get a list of snaphu configuration flags
  • matlab the matlab software should start

If you get “No, such file or directory” the corresponding line in the config file does not point to the correct location.

Hope, it is installed.

ubuntu-18043-psinsar@ubuntu18043psinsar-VirtualBox:~/Desktop/STAMPS/StaMPS-4.1-beta$ tcsh
ubuntu18043psinsar-VirtualBox:~/Desktop/STAMPS/StaMPS-4.1-beta> source StaMPS_CONFIG.tcsh
ubuntu18043psinsar-VirtualBox:~/Desktop/STAMPS/StaMPS-4.1-beta> mt_prep_snap
mt_prep_snap Andy Hooper, August 2017

usage: mt_prep_snap yyyymmdd datadir da_thresh [rg_patches az_patches rg_overlap az_overlap maskfile]
yyyymmdd = master date
datadir = data directory (with expected structure)
da_thresh = (delta) amplitude dispersion threshold
typical values: 0.4 for PS, 0.6 for SB
rg_patches (default 1) = number of patches in range
az_patches (default 1) = number of patches in azimuth
rg_overlap (default 50) = overlapping pixels between patches in range
az_overlap (default 50) = overlapping pixels between patches in azimuth
maskfile (optional) char file, same dimensions as slcs, 0 to include, 1 otherwise

ubuntu18043psinsar-VirtualBox:~/Desktop/STAMPS/StaMPS-4.1-beta> snaphu

snaphu v1.4.2
usage: snaphu [options] infile linelength [options]
most common options:
-t use topography mode costs (default)
-d use deformation mode costs
-s use smooth-solution mode costs
-f read configuration parameters from file
-o write output to file
-a read amplitude data from file
-c read correlation data from file
-b perpendicular baseline (meters)
-i do initialization and exit
-l log runtime parameters to file
-v give verbose output
–mst use MST algorithm for initialization (default)
–mcf use MCF algorithm for initialization

type snaphu -h for a complete list of options

ubuntu18043psinsar-VirtualBox:~/Desktop/STAMPS/StaMPS-4.1-beta> matlab
MATLAB is selecting SOFTWARE OPENGL rendering.

looks alright - good job! Then you are ready to go.

Thanks for your support.

I will revert if any issues during execution.

ubuntu-18043-psinsar@ubuntu18043psinsar-VirtualBox:~/Desktop/test/INSAR_20180114$ mt_prep_snap 20180114 /home/ubuntu-18043-psinsar/Desktop/test/INSAR_20180114 0.4 3 2 50 200

I have executed the above command. and 6 Patch folders are generated.

Do I need to execute all 8 steps as shown in manual or can I skip either one ?

no, all 8 steps are required, but it is good to perform one after another and keep track of the outputs.

But the commands are not with clear syntax for next steps in the manual.

Could you suggest how to frame the commands with corresponding syntax from step 2 on wards …!

once you have completed the preparation of the patches you simply start matlab and move to your working directory
then you type getparm to see if all parameters are loaded correctly and proceed with stamps(1,1)

I am getting this screen upon executing the command “getparms”

in the manual the command is “getparm”

which one is correct and how to resolve this error ?

yes, getparm is correct, but matlab needs to find this command.
Please add the folder of the StaMPS scripts to the environment variables of Matlab:

I furthermore recommend not to mix the export from SNAP with the processing files of StaMPS in one folder.

Are the matlab commands like follows for all 8 steps …!

.>> stamps(1,1)
.>> stamps(2,2)
.>> stamps(3,3)
.>> stamps(4,4)
.>> stamps(5,5)
.>> stamps(6,6)
.>> stamps(7,7)
.>> stamps(8,8)

yes. But as I said, it is important what the script prints.

I created a new directory and executed “mt_prep_snap” there itself.

stamps(1,1) executed success fully,
stamps(2,2) getting an error as follows

how many interferograms are you using?
Have you visually checked if the interferograms produced in SNAP look alright?

Please also consider these discussions on the same (or similar error):

in the SNAP help, it is showing to execute “mt_prep_gamma” script

in the manual, it is showing that, execute “mt_prep_snap” script.

which is the correct one to be followed?

“mt_prep_gamma” is showing in tcsh enabled terminal

in the terminal from execution folder, “mt_prep_gamma” is not showing.

I am using 22 Interferograms.

All are looking fine while opened in SNAP.

mt_prep_gamma was the one initially to be used, but it did not work for Sentinel-1 data very well.
Therefore, they released a second one (mt_prep_snap) at a later time which should be used now.
I recommend, creating a new work folder and running this script in there again. The files exported from SNAP can be maintained.


I have processed 30 scenes and obtained as follows.

How to analyse the results scientifically …!

w and u are not the most important plotting options. If you want to measure surface deformation, you need v, at best in combination with d and o.
The ts option also allows you to plot the displacement of a selected area.

It depends on your research question how you want to to analyze the results.

Extract from the manual
'w' for wrapped phase
'w-d' for wrapped phase minus smoothed dem error
'w-o' for wrapped phase minus orbital ramps ('w-dm', 'w-do', 'w-dmo')
'p' for spatially filtered wrapped phase
'u' for unwrapped phase
'u-d' for unwrapped phase minus dem error
'u-m' for unwrapped phase minus and master AOE
'u-o' for unwrapped phase minus orbital ramps
'u-a' for unwrapped phase minus topo-correlated atmosphere 
('u-dm', 'u-do', 'u-da', 'u-dmo', 'u-dma', 'u-dms', 'u-dmao', 'u-dmos')
'usb' for unwrapped phase of small baseline ifgs 
('usb-d', 'usb-o', 'usb-a' also 'usb-do','usb-da', 'usb-dao')
'rsb' residual between unwrapped phase of sb ifgs and inverted
'd' for spatially correlated DEM error (rad/m)
'm' for AOE phase due to master
'o' for orbital ramps
's' for atmosphere and orbit error (AOE) phase due to slave
'v' mean LOS velocity (MLV) in mm/yr ('v-d', 'v-o', 'v-a', 'v-do, 
'v-da', 'v-dao')
'vs' standard deviation of MLV (mm/yr) ('vs-d', 'vs-o', also 'vs-do')
'vdrop' MLV calculated from all but current ifg (mm/yr)
'vdrop-o' (also 'vdrop-do')

These might also help:

1 Like