Index exceeds the number of array elements - Step (1)

Hi everyone,

Does anyone had a problem of “Index exceeds the number of array elements”, when running Stamps first step?
here is the error:
Stemps 1

Any hints, what could be the source of error?

Thank you in advance
all the steps are correctly done (I hope), including naming of the folder (InSAR-masterdata), using mt_prep_snap and the master date (yyyymmdd), start matlab from the terminal, etc.

Just follow these below steps,


Thank you a lot for your quick reply. I came across this post several times till now; and I believe I am doing it exactly as it is described.
I have my master-data folder–> run mt_prep_snap in the shell–> open matlab in a directory (I also check that the path are selected properly); however, I still get the same error, as I posted before.

Is there any specific step that I might have overseen?
Why do I get the “Index exceeds the number of array elements” error?

I would highly appreciate any help :slight_smile:

Just type getparm in Matlab then send me the screenshot.

Here it is , and Thank you in advance :slight_smile:

Everything is ok. Could you please process mt_prep_snap once again like below.

mt_prep_snap masterdata (path up to INSAR_masterdate/) 0.42

The problem was most probabely related to my “master” image! I removed the image which was my master file, and re-do all the process again.
It worked without a problem :slight_smile:

Best regards and thank you for your support :wink:

1 Like

Thank you for sharing your solution.

1 Like


I am having the same error while running the first step of StaMPS.

Could you please explain to me what you mean by “I removed the image which was my master file, and re-do all the process again.”. do you did this in SNAP, when export to StaMPS? or after you ran mt_prep_snap?

I really appreciate any help you can give me


Before processing any step, we need to arrange the master image first. I think it is better to use python snap2stamps code.
In this below link they gave a clear manual for processing code.

dbekaert/StaMPS: Stanford Method for Persistent Scatterers (

1 Like


Thank you for the answer. I continue try to find where is my error and I think its something related with the processing in SNAP, so, I am going to process the data again


1 Like


I have the same error while running the first step of stamps.

Would you mind telling me if you have problems with this step “Interferometric->PSI/SBAS->Stamps Export” in the snap software? In this step, I can quickly get the four folders required to be output, but the progress bar will not change. I cancel the process and use the output file to continue processing according to the tutorial steps. I don’t know whether the error in the first step of stamps is related to the problem in snap.

I look forward to your reply and will thank you for any help.

Best wishes.