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

Because of this I would not say it was successful, just the software does not say… “Error”. But in fact… having inf as mean amplitude value is not much successful

Please would you send me your summary?
Thanks for your help!

Dear @mdelgado

I solved the ‘zero’ and ‘inf’ amplitude problem by using the way you said. Pscands files no longer is not empty. Thank you very much. I’m grateful to you. it worked changing the gcc version to 4.8 which is older. That was all. Now i ‘m on the next step. I got another error message approaching the end of PSI in MATLAB in Step 6. If you have any experience for this error, i will be waiting for help from you again. Can be seen some uploaded screenshoots to figure out my process of stamps, also what kind of matlab error message i get in step 6.(i tried stamps (1,7) for initial step in matlab). Best regards.

-Error using fread
İnvalid file identifier. Use fopen to generate a valid file idenifier.

I want also thank to @twburns that he gave me some hints about whole process.

I am glad that you solved it and that my advice were useful.

Regarding your new error I am wondering whether you got on your environment PATH variable before opening matlab the binaries of triangle and snaphu so the unwrap steps can go on.

Please check it out and let me know

Dear @mdelgado
Thank you for quick responding. No i did not get path variable before opening the matlab. I get source only CONFIG.bash. if it is needed to get path variable to triangle and shaphu, how can do it on terminal, i will be glad if you clarify. Best regards.


Not sure you get my point.
Be sure that the environmental variable PATH contains the folder where are found the triangle and snaphu binaries before launching matlab desktop

Dear @mdelgado

I added the environmental variable path contains the folder which have triangle and snaphu binaries as you said. Afterwards, error was gone. All steps are completed succesfully. Really thank you for your attention. Now i’m trying to show the results however i got error like below. i also have uploaded here parameters of ‘getparm’ which is in the matlab . Best regards.

Dear everybody! Thank you all very much for sharing your experience! Could you please explain for a beginner how exact are we running the script “mt_prep_snap”? Tried to do everything like manual told, but when i launch terminal in the INSAR YYYYMMDD folder and type mt_prep_snap 20180401 /backup/Sentinel-1 storage/KingQuarry/INSAR_20180401/ 0.4 (example of my fullpath), the program says that this script does not exist

if the script is not found you have to make sure that the directoriy where stamps was downloaded and extracted is correctly entered in the StaMPS_CONFIG file as mentioned in chapter 2.1 of the manual.
Basically, you need to adjust the first 10 lines of this script (part of the StaMPS download), at least the variables STAMPS, TRIANGLE and SNAPHU are required. If you preprocessed your data in SNAP, the others can be left as they are because they refer to previous parts in the workflow which are now done by SNAP.

Once you source this config file, these directories are added to the environment of the open shell and can be accessed from any other location as well.

Not sure but you defined a ref_center_lonlat but not a ref_radius.
Could you defined a ref_radius and try again?

yes i changed ref_radius as well. But there is no positive effect on the error. i still have problem unfortunately.

Then I guess it is needed to debug a bit the code where it gives you the error.

i don’t know what to do, i tried so many way to solve it. i ll continue to try but if you have a suggestion please share with me.

if no reference point is given, an average of all points is taken. Have you also tried

ref_centre_lonlat: [0 0]
ref_lat: [-Inf Inf]
ref_lon: [-Inf Inf]
ref_radius: Inf

Thank you for replying @ABraun ,
i tried your said too. But i got same error again. Maybe it connected with Matlab version i use . i m using 19 version which is the latest released

Here might be the issue!!
Lambda is NaN? With no lambda defined, cannot derive displacement from phase
as well as heading and the error message said cannot check if Envisat.

Could you please set up those parameters?
Which StaMPS version are you using?

This should be set up from early steps… step 1 . How did you manage to go through it without getting errors?

Hello everyone, i’m using oracle virtualbox to run my Linux Ubuntu OS.
I have installed StaMPS v.4.1b.
I’m currently having a problem with mt_prep_snap
Please take a look at my terminal below:

Best regards.

Please include the path where those binaries are which should be included when you load the StaMPS_CONFIG.bash

It seems that the running inside that folder does not recognized the other functions so be sure you include that path on the enviromental PATH variable or similar

Dear @mdelgado

Actually NaN doesn’t mean that ‘null’ , ‘0’ or ‘unnadjucted’. It refers ‘default’ and i think there is no obligation to change it exactly.

I have solved the problem that has forced me for a few days. I can say some hints to persons who may face with this kind of problem after completing all steps at matlab with StaMPS during plot processing. The most important thing is sequence of process.

1-Close the matlab and terminal when you see this error How to prepare Sentinel-1 images stack for PSI/SBAS in SNAP

2-Reprocess mt_prep script in the terminal

3-Run the matlab after mt_prep script in the terminal complete succesfully

4-If needed change entering setparm(scla_deramp…) and setparm(insar_processor)

5-Start the process in matlab typing stamps(,) step you want up to complete all 8 steps

6-After completing all 8 steps succesfully if needed setparm(centre_lonlat……) and setparm(ref_radius…)

7-Now can be displayed what you want to plot (see example below).

Best regards



Hello @mdelgado @ABraun @thho

i met something weird situation using with StaMPS_Visualizer 0.1 (Beta). After i exported csv file from the matlab, only 1 PS point is displayed. Could you say if i have to change smth. in standart code below or matlab process before export csv file .( i did not face any problem both exporting and displaying as kml format) Thank you.

ps_plot(‘v-do’, ‘ts’);
load parms.mat;
ps_plot(‘v-do’, -1);
load ps_plot_v-do.mat
lon2_str = cellstr(num2str(lon2));
lat2_str = cellstr(num2str(lat2));
lonlat2_str = strcat(lon2_str, lat2_str);

lonlat_str = strcat(cellstr(num2str(lonlat(:,1))), cellstr(num2str(lonlat(:,2))));
ind = ismember(lonlat_str, lonlat2_str);

disp = ph_disp(ind);
export_res = [lon2 lat2 disp ts];
metarow = [ref_centre_lonlat NaN transpose(day)-1];
k = 0;
export_res = [export_res(1:k,:); metarow; export_res(k+1:end,:)];
export_res = table(export_res);