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

Could you show me the folder PATCH1 for exmple and Did you change .m file provided by Feiliu? And did you change processor doris to gamma?


it looks like the bin directory is not in the matlab search path.

Add folders to the search path.

run the following:



The PATCH folders are not in an ideal directory. Running StaMPS will export files in its bin folder along with script files. It is recommended you rerun mt_prep_gamma and export in the master InSAR directory (where diff0, geo, dem, rslc are located).

Good luck


I also have the same results after @thho has helped me with the successful installation.

I have renamed my ps_initial_…(changed) file to the ps_initial file and removed the older “initial” file.
I have also done what some may have suggested as change the gamma in the getparm/setparm.

before I have made these changes, my error looks like this: PSI: Error on first step on Matlab

@ABraun I am using Linux Ubuntu but I also received the same error as you. Any new findings?

I am looking to view PS in highly urban area but there are a few nature reserves around, hence there should be obvious non PS areas in my project if it does succeed.

If anyone is stuck at the Linux phase of the installation, you can view the thread here Linux Installation using StaMPS and S-1 data

Hello @Fikretjfm,

It is a late response but maybe it is still helpful for you, and maybe it will be helpful for others. I just got the same error index out of bounds because size(ij)=[0,0]. I recognized that one scene was not processed properly. I noticed it during the mt_prep_gamma_snap step before entering matlab:

The scene of 2017 Nov 08 seems to have zero mean (see the WARNING message in terminal), which is highly suspicious. I had a look at the stack in SNAP and all bands of this date were empty. I think the error occurred during ApplyOrbitFileOP but I was not able to redo it. After processing a new split, apply orbit file, stack, deburst, subset and export, the warning during mt_prep_gamma_snap disappeared and I was able to run stamps(1,1) without a single problem!


Hi @Fikretjfm

This is the content from PACTH 1 folder

Hi again @Fikretjfm

I did the replace of the scripts mt_prep_gamma_snap to the /bin directory of StaMPS and ps_load_initial_gamma_snap.m to the StaMPS /matlab directory… :cry:

I did the change from insar processor doris to gamma

And later I typed stamps

Hi @gabrielaquintana77,

It is good to see you could handle some of error. I wonder after you changed the scripts ps_load_initial_gamma and mt_prep_gamma_snap, did you do mt_prep_gamma_snap step again and then just typed stamps??? I see stamps(4,5) so you need to do same steps with new scripts. Also is pscands.1.ij file empty or not?

After you do same steps again you will see psver.mat file, the program could not find this file right now.


Hi @kouhartsiouk

I did, in this moment, your suggested for me and this is the result


Yes, this file is empty… :sob::sob::sob:

You need to do mt_prep_gamma_snap step again with new script. Then you will see the .ij files will not be empty.


Hi @gabrielaquintana77 your screenshots and errors are very similar to those @hchong005 posted here. Please have a look in this thread, and follow the described steps, they may solve your problems.

1 Like

Thanks very much @Fikretjfm @thho @kouhartsiouk for your support, in this moment, I am checking all steps and making the modification necessary :disappointed_relieved:

how could to solve this problem… in matlab… can anybody help me

Hello everybody.
I’m trying to do InSAR from two Sentinel-1A images.
Based on @bayzidul steps, i’m wondering about two steps inside:[quote=“bayzidul, post:252, topic:4981”]

  1. Apply TOPS split and then Apply orbit file.
  2. Add scenes (Master+Slave1 and Master+Slave2 and so on ) to do the Backgeocoding separately for each Master-Slave pair.
  3. Create Stack of Backgeocoded images (master_Stack1, master_stack2 and so on).

I’ve done with the first step.
Now I’m trying to do the back-geocoding for only two images. When I was performing Radar > Corregistration > S1 TOPS Corregistration > S1 Back-Geocoding and click Run, the warning “Not able to write product” shown, so the process failed.

But when I did the back-geocoding for each image, it worked well.
The problem arised when I tried to stack those both images through Radar > Corregistration > Stack Tools > Create Stack. The error message “[NodeId: 2-CreateStack] S1 TOPS SLC products should use TOPS Coregistration” appeared, so I have no result of S1 TOPS Coregistration.

What I want to ask are:

  1. Why can’t I stack both of the geocoded images?
  2. What should I do to have the perfect coregistration result?

Fyi: I work with 4 GB of RAM and I’ve already checked “Use FileCache in readers to conserve memory” in the Tools > Options > S1TBX.

1 Like

Hello @Fonna

Please read the previous comments and then you will find some limitations and recommendations of PS processing with Sentinel-1 data using the combination of SNAP and StaMPS.

If you are using the current version of SNAP-6 then there are some changes in the steps that we had written here in previous discussions.

From my experience, you need at least 16GB memory and it is way more better to work in Linux. From you snapshots, my comment is to change the PC configuration first and even you have to choose the correct Geocoding method.


Thank you for your fast reply!
Maybe because I’m using SNAP-6, the steps I following had been changed
I will try to use another computer with greater RAM size to do the back-geocoding correctly.

Please, explain me more! :confused:

Hi @gabrielaquintana77,
You changed two scripts with new ones. Good. Now, you need to do mt_prep step again.

thanks for your reply @Fikretjfm

let me see if I understand, you talks about of make the processing with the command

mt_prep_gamma 20160208 /sdd/RESULTADOS1 0.4 2 2 50 200 again?!

if this is case, I did, but the pscands continued empty!!!

Yes but you changed the name of script to mt_prep_gamma or did you just copied and pasted new script into matlab folder. Because your command should be start mt_prep_gamma_snap not just mt_prep_gamma if you did not replaced with new one.