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

If fringes in the interferograms are correlated with topography it seems likely that for some reason the topographic phase removal was not performed properly.

Hey everyone. The forum has been very helpful so far in the SNAP > StaMPS workflow.
I’m running SNAP in Windows and MatLab/StaMPS in linux (Ubuntu)
I’ve hit a problem in Step 6 and could use some advice on solving it.

PS_UNWRAP, after Resampling phase to grid gets the following error:
“Index in postion 1 is invalid. Array indices must be positive integers or logical values.” (Screenshot attached)

Any ideas or suggestions would be appreciated.

Thank you,

is snaphu available to your system?

What source do you use to download the images ? Is it ASF or Copernicus ?

Hi @ABraun ,
Snaphu should be available to the system as far as I can tell:

  • snaphu resides in usr/local/sbin which is part of the PATH variable
  • I also updated the StaMPS_CONFIG.bash with: export SNAPHU_BIN="/usr/local/bin"
  • snaphu runs from the command line when called from any directory

(Note: I installed snaphu (v1.4.2) via the apt-get package management system since it was available. )

Hi @reyhanrere ,

ASF has been the source for the image granules I’ve been working with in SNAP.

Hi @ABraun

I checked my results in the processing, with the help of @Fikretjfm , the last time the errors was in the following:

mean amplitude was 0, this time was adjust

the lon and lat files had the size wrong, now was corrected

the .ij files had the size wrong, was corrected

Please take a look about this

Now with MATLAB r2016b and the scripts from Katherin, the program give me the following error (the same error with MATLAB 2010b)

Hi @ABraun please tell me which are the correct output from SNAP that you checked?

Thanks for advance

Hi everyone, hi @thho ,

Has anyone succeeded in processing SBAS following the snap-stamps flow that @thho provided? I plan to use snap in windows and stmaps in linux to take a shot. Since the data is large and the processing will take some time, I would like to assure myself before starting. Thanks a lot.


Hi @katherine,

I would like to ask why it should be split into several stacks if there are more than 13 images?



Hi @lunachen,

the workflow I have provided is meant for PS analysis with StaMPS, if you want to try SBAS with SNAP-StaMPS have a look here. At the moment I managed to process some stacks using the SBAS approach. It is not that intuitive but it seems to work, still we have to furhter investigate if the output is legit, my opinion is positive on that ;). However, if you want to join and test with your data, you are welcome :)!

Concerning your question to @katherine. It is good practice to adapt your number of images in one stack to your hardware/processing power. It might become a problem of memory capacity if you process large stacks. That is how I think about this note from @katherine in her workflow. For a reference, using an Unix based OS (Kubuntu) for SNAP and StaMPS (I highly recommend to work with one platform for all, especially if you want to use the SBAS workflow which uses a high amount of bash scripts etc. switching around many interfaces and software), an i5 processor 8th gen, 32GB RAM and a 500GB SSD, I was able to process stacks up to 40 images, but you have to select the right amount of bursts, for me one burst is enough, two bursts might exceed the hardware specification…so it depends on your studysite, research question and hardware…
In the end, if you do SBAS, in StaMPS the amount of interferograms is not the number of images minus one but mostly much more, therefore it is recommended to do spatial subsets of the selected bursts as well to reduce the amount of data to be processed…but you will find this information in the SBAS workflow mentioned above.

Good luck!


Hi @thho,

Thank you very much. It is really helpful.


Wonder if anyone has a lead on possible factors that cause array bounds errors in StaMPS(1,1) like the following:
“Index in position 2 exceeds array bounds.”

Have been able to overcome step 1 array errors with some SNAP exports but not others with no discernible pattern to success or failure thus far.

Thanks you,


Hi @twburns,
I have exactly the same error. If you have any solution please share!

BTW @twburns did you got WARNING in mt_prep step?
I got for one product, so as above thho had advised I checked my data and something went wrong for split. Now I am doing again the SNAP process so if the problem solved by this I gonna let you know.

Yes this was the solution! check your mt_prep result for any WARNING!

Hi all, my results, now my error is
JavaSceneServerPeer problem: Couldn’t create JOGL canvas–using painters
and a interferogram is in blue!!! :sob::sob::sob:

did you see this discussion?

Is 05 Oct 2016 your master date?

thanks @ABraun I will go these discussion…

Yes, 05 Oct 2016 is my master date :flushed:, why??? :disappointed_relieved:

interferograms can only be computed between image pairs. All pairs are computed against the master, 05 Oct 2016. Consequently, an inteferogram based on 05 Oct 2016 with itself is not possible.