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

Latest SNAP-StamPS workflow hurdle, getting ps_plot() to work.

Thanks to this forum I’ve been able to get StaMPS to run to completion all the way to Stamps(1,8) using SNAP and sentinel-1 images. However, at no point have I been able to get ps_plot() to work at any stage of the process.
The errors always seem to be a variation of:

Warning: Colon operands must be real scalars.
In ps_plot (line 1401)

Warning: Colon operands must be real scalars.
In ps_plot (line 1402)

Index exceeds array bounds

Anyone have any suggestions or experience overcoming this type of issue in the workflow?

Thank you.

(I’m running SNAP_6.0 in Win7 and StaMPS_3.3b1/Matlab_R2018a in Ubuntu18.04)

I was able to do some plotting, but also not any of the available options. Is viStaMPS a solution for you or the one @thho pvovides here: StaMPS-Visualizer, SNAP-StaMPS Workflow

Thanks for the suggestions @ABraun, especially the link to StaMPS-Visualizer by @thho , seems great from the test/example data included.
(Only problem is it still requires proper StaMPS ps_plot() functionality to create the csv export, thus I’m still hope someone can help overcome the ps_plot) “Colon operands must be real scalars. warning which apparently leads to an array bounds index error”)

Hi all,
What is the general opinion about ESD step after back geocoding?
According to some articles, it seems necessary, although none of the workflows mentioned here.
I also face some difficulties implementing this step in case of a stack.

Hello,
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,

@saidbenchelha
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.

@ledotimea
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.

@twburns
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.
Regards
ASVirk

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.

Cheers

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?
Thanks

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.

Todd

Hi,

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,
Andrew

are the coordinates alright in Matlab when you use ps_plot?