PSI: Error on first step on Matlab

Hello @thho,
My hardware is Xeon® Silver 4210 CPU @ 2.20GHz, 40 CPUs, 2 threads per socket.
Regarding parallelism, page #20 on StaMPS manual says:

Parallelisation of steps 1-5 for patch processing.
You can run stamps_mc_header(start step,end step) just like conventional
stamps(start step,end step) to increase the processing speed of the first 4 steps of StaMPS. You can specify the number of cores to be used using setparm(‘n cores’,XX), where XX are the number of cores to be used.

Anyway, I tried to use setparm(‘n_cores’, something bigger that 1) but it says that I cannot do that because I don’t have need for that, something like that. I think it’s because I have only 1 patch.
I tried it again later, and it let me set the n_cores parameter, but when I typed stamps_mc_header it says:

Decrease number of cores, as lesser patches are being processed…
1Done

Hello @ABraun,
I used stamps(0,x) because it says on page #20:

Re-start processing from last succesfull step.
You can run stamps(0,end step) or stamps_mc_header(0,end step) with the startstep set to 0. In this case StaMPS will check which is the last completed step for each patch prior to starting the next step.

That’s why I uset stamps(0,x), I wanted to be sure that the last step is completed. And that is exaclty the reason for my question -
If it starts from the last completed step, why does stamps(0,6) starts from
**** step 4 ****

**** step 5 ****

I want to emphasize that it does only minor calculations (if any) now, and then procceed to step 6. It’s not like running steps 4 and 5 for the first time.

Oh, I didn’t know that, sorry. In this case, it seems fine!

Thank you very much for the info, your fix worked for me.

Hi everyone, I’m running Stamp s and at step 1 it gives me an error message ps_load_initial_gamma. I checked the snap export and everything is ok.
The error is on line 70. I share the screenshot.


I am not a matlab expert I ask for your help, thanks to anyone who can help me.

Please try below one.

1 Like

thanks suribabu but it didn’t help, i decided to modify line 69 by removing the +1.
I would like to ask you two questions.

  1. is it correct what I did?
    i don’t understand how it works, but it seems to work.
    i share the screenshoot and the modified file.ps_load_initial_gamma.m (7.3 KB)
    I hope I didn’t make an irreparable mistake.
    2)I would like to understand why it doesn’t work, does anyone have any ideas?


Thanks for the support

Instead of changing code. Please reprocess the mt_prep_snap step once again. I feel changing code is not a good idea because it’s working for most of the users.

ok thanks suribabu for the advice I am re-running mt_prep_snap with these parameters 0.40 4 26 70 200 because the export contains two complete iw’s (IW2 and IW3). In this way the patches contain about 5 million pixels, is this correct approach?

SNAP providing only for one swath right (IW1 or IW2 or IW2).
How to do IW1 and IW2 combinedly at a time in SNAP?

I followed the method here on the forum on the Workflow between SNAP and StaMPS tread.

it is very useful

2 Likes

How many images are you using for Stamps export?

I performed a test with 6 interferograms. The final project will use 137. I decided to make 6 product stacks. What do you think? Could the test be too few interfergrams?

Minimum 20 interferograns required for StaMPS(mentioned in this forum only). Better go for python wrappers.

Thanks suribabu for the help, I am exporting 16 more images. I hope this solves the problem. I have tried mt_prep_snap again, it does not give any error, no empty interferograms.

One more solution for this without unintalling the Matlab, insar_processor Changes Doris to snap.
like below.

setparm(‘insar_processor’, ‘snap’)

hi @suribabu , I imported all 131 images, I used mt_prep_snap with the following setting 0.4 26 4 70 200, I restored the ps_load_intial gama script but now it gives me an error when it gets to PATCH_3 I add a screenshot:


I read on the forum to double check all the interfergrams and @ABraun says to execute everything on a single PATCH (Workflow between SNAP and StaMPS - #503 by Gijs), how can I solve it according to you?
what did you mean by “Better go for python wrappers”?
One last thing to ask @suribabu, the last post you wrote was about my problem "One more solution for this without unintalling the Matlab, insar_processor Changes Doris to snap.
like below. "?
thank you all for the help. I am learning a lot.

this is only an option when your area is small and the error is related to the merging of the patches. Can’t say what’s the reason in your case, sorry.

dear @ABraun , i checked pscands.1.ij files in all 131 patches and there are many empty files. But I checked the files in rslc and diff0 there are no empty files. i checked the ifg there are no wrong files. Maybe there is something wrong with mt_prep_snap, I’m trying with less patch, is that wrong?

The result of the check follows:
(base) fabio@unict:/media/fabio/work_ssd/project2/INSAR_20190109$ ls -l ./PATCH_/.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:36 ./PATCH_100/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:37 ./PATCH_101/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:38 ./PATCH_102/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:39 ./PATCH_103/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:41 ./PATCH_104/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 2346245 Jul 1 19:46 ./PATCH_10/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:47 ./PATCH_11/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:48 ./PATCH_12/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 5130767 Jul 1 19:50 ./PATCH_13/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 1597871 Jul 1 19:53 ./PATCH_14/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:54 ./PATCH_15/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:55 ./PATCH_16/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 1670393 Jul 1 19:58 ./PATCH_17/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 455262 Jul 1 20:00 ./PATCH_18/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:01 ./PATCH_19/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 936499 Jul 1 19:23 ./PATCH_1/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:02 ./PATCH_20/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 63647 Jul 1 20:04 ./PATCH_21/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 133343 Jul 1 20:05 ./PATCH_22/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:06 ./PATCH_23/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:07 ./PATCH_24/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 59912 Jul 1 20:09 ./PATCH_25/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 140653 Jul 1 20:11 ./PATCH_26/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:11 ./PATCH_27/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:12 ./PATCH_28/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 125697 Jul 1 20:15 ./PATCH_29/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 3270247 Jul 1 19:27 ./PATCH_2/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 68509 Jul 1 20:16 ./PATCH_30/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:17 ./PATCH_31/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:18 ./PATCH_32/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 63753 Jul 1 20:20 ./PATCH_33/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 253346 Jul 1 20:21 ./PATCH_34/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:22 ./PATCH_35/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:23 ./PATCH_36/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 132864 Jul 1 20:25 ./PATCH_37/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 350688 Jul 1 20:27 ./PATCH_38/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:27 ./PATCH_39/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:30 ./PATCH_3/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:28 ./PATCH_40/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 170157 Jul 1 20:30 ./PATCH_41/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 267694 Jul 1 20:32 ./PATCH_42/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:32 ./PATCH_43/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:33 ./PATCH_44/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 165584 Jul 1 20:36 ./PATCH_45/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 203876 Jul 1 20:37 ./PATCH_46/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:38 ./PATCH_47/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:39 ./PATCH_48/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 138391 Jul 1 20:41 ./PATCH_49/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:31 ./PATCH_4/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 150141 Jul 1 20:43 ./PATCH_50/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:43 ./PATCH_51/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:44 ./PATCH_52/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 2608 Jul 1 20:47 ./PATCH_53/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 3132 Jul 1 20:48 ./PATCH_54/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:48 ./PATCH_55/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:49 ./PATCH_56/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:50 ./PATCH_57/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:51 ./PATCH_58/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:52 ./PATCH_59/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 4403084 Jul 1 19:33 ./PATCH_5/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:53 ./PATCH_60/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:54 ./PATCH_61/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:55 ./PATCH_62/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:56 ./PATCH_63/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:57 ./PATCH_64/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:58 ./PATCH_65/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 20:59 ./PATCH_66/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:00 ./PATCH_67/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:01 ./PATCH_68/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:02 ./PATCH_69/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 4840723 Jul 1 19:38 ./PATCH_6/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:03 ./PATCH_70/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:04 ./PATCH_71/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:06 ./PATCH_72/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:07 ./PATCH_73/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:08 ./PATCH_74/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:09 ./PATCH_75/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:10 ./PATCH_76/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:11 ./PATCH_77/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:12 ./PATCH_78/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:13 ./PATCH_79/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:40 ./PATCH_7/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:14 ./PATCH_80/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:15 ./PATCH_81/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:17 ./PATCH_82/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:18 ./PATCH_83/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:19 ./PATCH_84/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:20 ./PATCH_85/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:21 ./PATCH_86/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:22 ./PATCH_87/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:23 ./PATCH_88/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:24 ./PATCH_89/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 19:41 ./PATCH_8/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:25 ./PATCH_90/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:27 ./PATCH_91/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:28 ./PATCH_92/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:29 ./PATCH_93/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:30 ./PATCH_94/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:31 ./PATCH_95/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:32 ./PATCH_96/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:33 ./PATCH_97/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:34 ./PATCH_98/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 0 Jul 1 21:35 ./PATCH_99/pscands.1.ij
-rwxrwxrwx 1 fabio fabio 4969791 Jul 1 19:43 ./PATCH_9/pscands.1.ij

Thanks for support

based on the error message you have 100 patches which would be way too much.

Please delete your working folder and run mt_prep_snap again with only 4 patches (command ending with 2 2)

1 Like