How to prepare Sentinel-1 images stack for PSI/SBAS in SNAP

to detect the soil diplacement with the PSI method of sentinel images with snap and stamps. I followed the steps of bayzidul (from 1 to 12), I have not realised the steps 13 and 14 concerning Run mt_prep_gamma.
ı need help on running mt_prep_gamma script .
can you explain me this steps in detail?

thank you very much

Hi all,

For the mt_prep you should just follow the StaMPS manual.
For me it works the modified mt_prep_gamma_snap for which you should get amplitude average per scene higher than 0.xxxx in my cases between 50 - 80.

mt_prep_gamma_snap usage is indicated while running it without parameters, more or less as follows:
mt_prep_gamma_snap <INSAR_path> amp_disp_thr patch_x patch_y

being INSAR_path the folder which contains the rslc, diff0 and geo folder after exporting the snap interferograms into StaMPS format for PSI using SNAP.

on the thread: Snap2stamps package: a free tool to automate the SNAP-StaMPS Workflow you can get a new package which includes the ESD in the xml graphs to run using SNAP. This new package uses python and snap, so it should work in Windows, Linux and Mac.

For the ps_plot issues that you mentioned… please check as I have not any problems. ps_plot(‘v’), ps_plot(‘v-d’,1,‘ts’), ps_plot(‘v-d’,-1), ps_plot(‘d’) worked fine for me. Only when the ps obtained are very high, I got memory issues with Matlab.

I hope this helps.

1 Like

Is Stamps working satisfactory in windows?
If yes please tell how to install Stamps in windows.

a clear no. I tried it many times on different computers but there is always something. If you really are an expert on both systems and their combatibility (especially shell scripts) you could probably get it running but I would highly disadvise because you then never know if upcoming errors were caused by processing parameters or the operating system.

ok thanks ABraun

I would like just to add something:
Purely speaking, StaMPS itself are the matlab scripts (found inside the matlab folder within the stamps package) for doing PSI/SBAS/MTI , which obviously runs on MATLAB and hence, it should work on Windows, Linux or any other platform in which MATLAB runs. (please note that snaphu and triangle should be also installed in the system and included in the path).

The rest of the scripts provided within stamps package, are for the interferogram computation and SAR SLC image coregistration and resampling, that must be done previously to StaMPS. Currently there are different options to do this part that works also in Windows, such as for example you can use SNAP (v6.0) for doing the interferograms compatible with StaMPS PSI (and you can use the snap2stamps script for doing those interferograms automaticaly) . See the thread : Snap2stamps package: a free tool to automate the SNAP-StaMPS Workflow

The mt_prep scripts, that are used after interferograms and before StaMPS, which translates the interferograms in StaMPS compatible input runs on linux or similar (as they are bash/ctsh scripts using other functions) , and then you could face some issues as indicated by @ABraun before.

But if your plan is to do everything (interferograms + PSI/SBAS/MTI) using only the stamps package, then the answer is the same as given by @ABraun.


that is right, thank you for pointing that out. I was minly speaking of the mt_prep_gamma script which needs to be executed before StaMPS itstelf.

But as you also mention, running the Matlab scripts on a Windows machine requires proper compilation of triangle which is designed for Linux in the first place. Furthermore, commands like “rm” which are called by the StaMPS Matlab scripts, are not recognized by Windows.

1 Like

thanks a lot Mdelgado for your clarification.

I missed that part, but indeed do not discard that matlab scripts can call system commands internally, which will need to be reviewed/changed when needed.

I should try to run stamps matlab scripts on windows once…

Thank you so much thho. ill update you soon.

Hi Thorsten

I´ve been using this script to export TS as a CSV file (as it´s explained in the manual). And I cannot do anything but the plot map (ps_plot’v-d or do’) Do you have any tip?

Error using load
Unable to read file ‘ps_plot_v-do.mat’. No such file or directory.

Undefined function or variable ‘lon2’.

Did you mean:
Undefined function or variable ‘lat2’.

Did you mean:
Undefined function or variable ‘lon2_str’.

Undefined function or variable ‘lonlat’.

Undefined function or variable ‘lonlat_str’.

Undefined function or variable ‘ind’.

Undefined function or variable ‘lon2’.

Did you mean:
Undefined function or variable ‘day’.

Undefined function or variable ‘export_res’.

Undefined function or variable ‘export_res’.

Undefined function or variable ‘export_res’.

Dear @CarlosSierralta,
just to be certain what you have done so far, did you plot a ps_plot with ts option and did select radius to look at the points you are interested in? For me it looks like that you have not plotted with ts option, you have to do this because the objects which are reported in your error messages are created during this step.

hope that helps a bit, let me know if the error persists

Thanks Thorsten, I’ll check it and let you know

Hey everyone thanks to all the help and resources here I’ve been able to successfully run the SNAP>StaMPS workflow for PS using a 9 Sentinel-1 1 images. : ) Thanks to all especially @katherine, @ABraun, @thho.

Now, however, I was wondering about generating a larger stack for export using a greater number of interferometric pairs generated from a combination of a small number of images. Such that say starting with just 9 images one could create about 38 ifg pairs (ie those pairs with Bperps < 150m) which would then used to create a larger Stack in SNAP for PS export and use with StaMPS?

I’ve seen this process mentioned in several papers in relation to PS, not SBAS as I would have expected, but haven’t read or figured out how it might be done with SNAP. Any thoughts, leads or ideas would be appreciated. Due to seasonality and $$$ limitations I will ultimately be applying the techniques learned to small number TerraSAR X images for ground subsidence research.



i ran successfully the snap + stamps workflow on Sentinel-1 IW ascending stack (2 year, 25 images, ca. 800 km2). Unfortunately something turned bad, because if i’m export the result with ps_gescatter, or the ps_output command, the PS points are not in the geocoded location. The study area is in the middle of Europe, but i got coordinates around [0,0].
About my workflow:

  • SNAP 6.0, and STAMPS (Linux), following the recommendations by the STEP forum users (and thho html extract)
  • I “checked” the “Output Orthorectified Lat/Lon” on Interferogram formation (actually, i use graphs, where the outputLatLon parameter is true).
  • I got the orthorectifiedLat and orthorectifiedLon bands, and the pixel values are ok after the interferogram formation. Everything looks great.
  • At the stamps export library, what i get when i run the Stamps Export from SNAP, in the *.diff.par files, the center_latitude and center_longitude values are ok.
  • In STAMPS, i followed the official user manual.

The informations, what i got:

After all, i have no idea what is wrong, so any suggestion will be appreciated :slightly_smiling_face:
Many thanks,

are the coordinates alright in Matlab when you use ps_plot?

Hi guys !

Thank you so much for the topic, it helped me a lot !
I used Snap v6.0.4 and I succeeded to process my Sentinel-1 data using the processing chain presented by bayzidul and others for PSI (without the ESD step).
I have pictures between October 2014 and December 2017 for a total of 130 scenes with both S1-A and S1-B.
The selection of persistent scatterers is quiet good, I have pixels only over man-made infrastructures and point locations are pretty similar to what I got with ERS and ENVISAT results.

However, at the end, my time series is highly dispersed with more than 1 cm of difference between two consecutive dates while the real displacement is less than that.

Does someone face the same problem than me or know what could be the problem?

Kind regards,
Guillaume Modeste

if this only affects one image pair it is likely that atmospheric disturbance is playing a role. Did you try to remove some of this noise by changing the weed_alpha and weed_standard_deviation flags for a higher number of points are dropped?

Hi, actually i run matlab with -nodesktop -nosplash -nojvm, so I have not any UI, only terminal. How can i export to file the ps plot? Sorry, i am a matlab beginner :slight_smile:

Thank you for the quick answer.

My area of study is small, less than 50 km per 50m, and the topography is flat, so I don’t think that the atmospheric disturbance is so important.
The dispersion is more important over the only S1-A period and get smoother when S1-B arrives, but still leeds to a hardly linear curve …

I am going to try with the weed_standard_deviation parameter but I don’t know nor see the weed_alpha parameters on StaMPS …