Workflow between SNAP and StaMPS

the same problem here

Hi @annamaria I have the files in their respective folders in STAMPS directory. But I can´t run STaMPs as the manual says. There’s a trick for this? (I have modified the Mt_prep_gamma and the config.bash files in order to prepare them for matlab)
Thanks in advance

Hi SAR colleagues

I have done a 34 SLC images stack using the algortithm proposed in the html SNAP to StaMPs manual. I’ve sorted many problems just reading this great thread (my first Linux experience,and in Azure, for worst), but I’m stucked now in the launch of StaMPs. I have all the files properly saved in their directories, but I’m still confused with. According the manual, you have to run StaMPs from terminal, and according to simple algorithm posted by @katherine, you coul do it from matlab.
Please, any help will be appreciated.
Thanks and regards

I just ran mt_prep_gamma and it throws the next error
pmatuser@DataScienceSAR3:~/StaMPS_v3.3b1$ mt_prep_gamma snap 20171212 /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/ 0.4
mt_prep_gamma Andy Hooper, December 2012

Amplitude Dispersion Threshold: /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/
Processing 0.4 patch(es) in range and 1 in azimuth

20171212/*slc/snap.*slc.par: No such file or directory.
20171212/*slc/snap.*slc.par: No such file or directory.
ls: cannot access ‘20171212/slc/.*slc’: No such file or directory
cat: /home/pmatuser/StaMPS_v3.3b1/calamp.out: No such file or directory
@: Badly formed number.

If I list the archives in the rslc folder, I can see the 20171212.rslc and 20171212.rslc.par files
pmatuser@DataScienceSAR3:/media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/rslc$ ls
20170522.rslc 20170826.rslc.par 20171212.rslc 20180318.rslc.par
20170522.rslc.par 20170907.rslc 20171212.rslc.par 20180330.rslc
20170603.rslc 20170907.rslc.par 20171224.rslc 20180330.rslc.par
20170603.rslc.par 20170919.rslc 20171224.rslc.par 20180411.rslc
20170615.rslc 20170919.rslc.par 20180105.rslc 20180411.rslc.par
20170615.rslc.par 20171001.rslc 20180105.rslc.par 20180423.rslc
20170627.rslc 20171001.rslc.par 20180117.rslc 20180423.rslc.par
20170627.rslc.par 20171013.rslc 20180117.rslc.par 20180505.rslc
20170709.rslc 20171013.rslc.par 20180129.rslc 20180505.rslc.par
20170709.rslc.par 20171025.rslc 20180129.rslc.par 20180517.rslc
20170721.rslc 20171025.rslc.par 20180210.rslc 20180517.rslc.par
20170721.rslc.par 20171106.rslc 20180210.rslc.par 20180529.rslc
20170802.rslc 20171106.rslc.par 20180222.rslc 20180529.rslc.par
20170802.rslc.par 20171118.rslc 20180222.rslc.par 20180610.rslc
20170814.rslc 20171118.rslc.par 20180306.rslc 20180610.rslc.par
20170814.rslc.par 20171130.rslc 20180306.rslc.par 20180622.rslc
20170826.rslc 20171130.rslc.par 20180318.rslc 20180622.rslc.par

Dear @CarlosSierralta,
When you said… “I have modified the Mt_prep_gamma” , how had you done it exactly?

As I have already replied yesterday in this thread: Snap2stamps package: a free tool to automate the SNAP-StaMPS Workflow , you only need to modify the s by an f on the lines there mentioned.
Let me know and you still have the problem after trying that, I will share with you my modified script.

Regarding matlab, it can be run via GUI or via command line if you run it with the -nodesktop option.

I hope that this helps!

I’ve modified this data directory structure, for the paths I’m using:

Expected directory structure:








geo/YYYYMMDD.lon (master)

geo/ (master)










geo/YYYYMMDD.lon (master)

geo/ (master)



You use wrongly the command… still not clear why you write snap as a first parameter… the command should be launch as follows:

mt_prep_gamma 20171212 /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/ 0.4

note that there is no snap written on this command. Still not clear why you included it
and please modify the command mt_prep_gamma as mentioned on the thread :Snap2stamps package: a free tool to automate the SNAP-StaMPS Workflow

It should work.
Please let me know.

pmatuser@DataScienceSAR3:/$ mt_prep_gamma 20171212 /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/ 0.4
mt_prep_gamma: command not found

Isn’t working. When I use the snap command, at least the command run (I’m using ubuntu17.10)
mt_prep_gamma snap 20171212 /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/ 0.4
mt_prep_gamma Andy Hooper, December 2012

Amplitude Dispersion Threshold: /media/datadrive/SAR/PSI_SBAS/SANTIAGO/INSAR_master_date/
Processing 0.4 patch(es) in range and 1 in azimuth

20171212/*slc/snap.*slc.par: No such file or directory.
20171212/*slc/snap.*slc.par: No such file or directory.
ls: cannot access ‘20171212/slc/.*slc’: No such file or directory
cat: /home/pmatuser/StaMPS_v3.3b1/calamp.out: No such file or directory
@: Badly formed number.

This is a huge headache, thanks for helping with it

this originates from updated scripts provided by katherine back in October 17 who was also in contact with Andy Hooper. Together they modified mt_prep_gamma so that it matches the outputs of the SNAP export. Workflow between SNAP and StaMPS

Now that snap2stamps is available it is probably worth to see which of them is the one to use best in the future because there are ovisously some differences and probably not both work with the routines provided.

I guess you talked about the mt_prep_gamma_snap (one single word) and not mt_prep_gamma snap (two words)
As you can see in Carlos post, it takes as Amplitude dispersion a path instead of a threshold.

I look forward for an official mt_prep_snap comming from StaMPS, so people stops to be confused about it.

For me even the Katherine scripts work fine, but I remember to get still an issue with the singlecomplex and not floatcomplex format.

Please see attached the file I use. It works perfectly for me.
mt_prep_gamma_snap(changed) (6.4 KB)

sure, it doesn’t make sense without the underscore but I think that this is what Carlos meant. But yes, it needed to be pointed out still, thank you.

@ABraun @mdelgado Thanks! I will try it right now. I will overwrite the previous mt_prep_gamma file with this one and let you both know

I guess there is a problem with the config.bash file that I’ve modified wrongly. Plus, there are some software I do not have installed (I have installed Doris, Triangle, csh, snaphu, pygeoj, etc)

Are all of those software listed in config.bash needed?

Thanks again @ABraun @mdelgado

if you prepared your interferograms in SNAP, you don’t need most of them. snaphu is required for unwrapping (called from matlab later) and triangle as well, if I remember correctly.

1 Like

That’s depends what you want to do…

  • I still use DORIS for processing ERS, Envisat or other STRIPMAP data.
  • Surely triangle and snaphu are needed by StaMPS.
  • Csh is normally installed in system directories which are normally included in the standard PATH, so normally you do not need to add it (only in case you decided to install it in a different folder)
  • Not sure why you need pygeoj

In addition, ROI_PAC might be needed if you work with level 0 data.

So my advice is to keep in the config file only software that you know you need, and the ones needed by the software you use.

I hope this helps!

@mdelgado @ABraun thanks. I don’t know if I’m a stupid or just the new kid on this neighbourhood, but the error was in Config.bash file. I didn’t edit as @thho explained in the manual… I’m a lamer

Do not blame yourself! Live is to learn! And for sure you have just done it!

Enjoy the InSAR world!

Estimado Jose Manuel @mdelgado

Estoy trabajando con una porcion bastante grande de la ciudad de Santiago de Chile. Como consecuencia, STAMPS encontro 12.6M de candidatos, que fueron bajando conforme la seleccion se fue afinando en las etapas 3 y 4. Sin embargo, en el paso 5, me arroja un error que no se modificar> El tamano de pixel (28) es menor al radio de busqueda (32). Modifique el ultimo parametro en el editor de matlab y en la linea senalada baje el radio a 16. Sin embargo, matlab sigue arrojando el mismo error.
Te copio el log, por si tienes tiempo y la gentileza de observar donde puedo corregir el error.
De partida, comenzare bajando el threshold inicial a 0.3, entendiendo que en una ciudad altamente urbanizada como la mia, hay mucha chance de encontrar blancos reflectantes persistentes (me tomo algo asi como 16 horas realizar los pasos 3 y 4). Y talvez suba la StDv del weeding a 1.5, para seleccionar mas candidatos refinados, creyendo que por ahi puede estar tambien el problema del radio de busqueda.
Va sin tildes porque en Linux no encuentro algunos caracteres.
Saludos y gracias de antemano

STAMPS.log (3.3 KB)

Dear Carlos,
In the attached file I can only see the parameters you have defined, and based on that step 5 should be skipped… as no merging parameters had been set.
Can you please provide the StaMPS log? If would need, we can try to discuss about it carefully or send me a private message.
Jose Manuel

Dear @CarlosSierralta ,

Can you please stick to Englisch. So that we all can understand what your post is about.

Here the translation by
Dear Jose Manuel @mdelgado
I am working with a fairly large portion of the city of Santiago de Chile. As a result, STAMPS found 12.6M candidates, which dropped as the selection was fine-tuned in stages 3 and 4. However, in step 5, I got an unchanged error> The pixel size (28) is smaller than the search radius (32). Modify the last parameter in the matlab editor and in the line marked down the radius to 16. However, matlab still makes the same mistake.
I copy the log, in case you have time and the kindness to observe where I can correct the error.
From the start, I will start by lowering the initial threshold to 0.3, understanding that in a highly urbanized city like mine, there is a good chance of finding persistent reflective targets (it took me about 16 hours to complete steps 3 and 4). And maybe I’ll raise the weeding StDv to 1.5, to select more refined candidates, believing that there may also be the problem of search radius.
It goes without accents because in Linux I can’t find some characters.
Greetings and thanks in advance

1 Like