PSI: Error on first step on Matlab

I had the same problem, I solved running matlab using csh

hello!

have you solved it?

Dear all,
i managed to export the snap to gamma format and do the mt_prep_gamma
Finally, when i start with my stamps processing in matlab. I get the following error:
when i run the first step of stamps:

Index in position 2 exceeds array bounds.

Error in ps_load_initial_gamma (line 108)
rg=rgn+ij(:,3)rps;

Error in stamps (line 263)
ps_load_initial_gamma;

Please do help if anyone knows what to be done with this.
@thho @ABraun Can you help me with this ?

Hi @Narayanee,
when you are using StaMPS v4.x use mt_prep_snap, not the gamma script, this was done in version 3 but is not necessary any more, since snap has now it’s own preparation script.

Thank you so much. @thho
but i still continue to get the same error. So i tried looking into the files of patch 1 created after running mt_prep_snap.
I opened the ps_load_initial_gamma.m file to look at the code. this line
ijname=[’./pscands.1.ij’]; has the variable initiative. This variable is further used as ij which is shown as error in my previous post.
so i tried opening this file and there was no data in it which i found it strange. Is it the same way for everyone or am i doing some mistake?

Most of the time, when I did had this error or people here reporting it, is because of a wrong preprocessed interferogram in SNAP. Before exporting, I always suggest to double check all interferograms. This is what I would do first, hope that helps a bit.

hey,
Thank you. I had problem with my interferogram as you said. Thank you for your insight.

With regards
Narayanee

1 Like

I face a problem like you how do you correct it ?

Hello @abity,
Did you find a way to fix that problem with Error in ps_load_initial_gamma?
As @Narayanee described, my pscands.1 files are also empty.
@thho suggested to check the interferogram before exporrting. What does it mean “to check them”?

Thanks,
Oded

In StaMPS it is a good thing to plot the ifgs and look at them visually, when you see very noisy ifgs which might come from atmosphere, snowcover whatever it is a good thing to exclude them from the further processing steps in StaMPS since they can lead to wrong weeding of points for instance. It is a subjective task and when you do it the first time you have to experiment a bit. I suggest to take precise notes of why you decided to exclude and what that did to your end result, and iterate this process to get a feeling…I had to do it every time, since ech study site is defferent…topography, atmospheric conditions, surface cover etc.

1 Like

@thho, Thank you!
I will do that.
You said to plot the ifgs - you mean to visualize them using Snap?

Oded

About the pscads. 1 files - should they be empty when I start processing with matlab?

Hello @thho,
It took me 2 weeks to understand better how to deal with SNAP, snap2stamps and StaMPS.

I finished successfully the snap2stamps chain, and all interferograms are ok.
I run mt_prep_snap and it’s also ok.
When I run stamps(1,1) in Matlab, it finishes successfully but it also says:

ix_0 =

0×1 empty double column vector

PS_LOAD_INITIAL_GAMMA: Finished
STAMPS: Finished

When I check with ps_info it looks ok:

ps_info
1 12-May-2020 2 m
2 24-May-2020 -4 m
3 05-Jun-2020 105 m
4 17-Jun-2020 15 m
5 29-Jun-2020 10 m
6 11-Jul-2020 7 m
7 23-Jul-2020 31 m
8 04-Aug-2020 31 m
9 16-Aug-2020 -32 m
10 28-Aug-2020 -101 m
11 09-Sep-2020 -84 m
12 21-Sep-2020 -50 m
13 03-Oct-2020 0 m
14 15-Oct-2020 -7 m
15 27-Oct-2020 -35 m
16 08-Nov-2020 -93 m
17 20-Nov-2020 -105 m
18 02-Dec-2020 20 m
19 14-Dec-2020 -1 m
20 26-Dec-2020 21 m
21 07-Jan-2021 10 m
22 19-Jan-2021 -23 m
23 31-Jan-2021 -71 m
Number of stable-phase pixels: 1165393

Yet, that line “0×1 empty double column vector” looks suspicious - is that a normal behaviour?

Thanks,
Oded

I remember this message and think you can proceed. But keep an eye on the outputs

Good job on getting into the processing.

1 Like

hmm tbh I can not remember if I saw such an message or not…and I am not sure what it means. What happens when you proceed with the processing? Does StamPS accept the loaded PS?

Right now I can’t go further because I need the Signal Processing Toolbox.
It’s on its way though.
I tried to import the required functions from Octave’s signal processing toolbox but it gets to a functions that Octave’s toolbox does not supply.

Regarding the “ix_0” - It starts in the ps_load_initial_gamma.m script :pouting_man:

EDIT:
ok I found the source for that message.
ps_load_initial_gamma.m line # 211:

% removing 0 values if present in lonlat, phase
ix_0 = find(lonlat(:,1)==0)

So, as you can see - the ‘;’ is missing and therefore it prints out the result, that’s all.
Since it looks for zeros, I think that the result “0×1 empty double column vector” is a good one, what do you think?

Oded

Hello,
I got the signal proccesing toolbox, abd it’s working.
Steps 3-4 took quite long time, some hours. I have 22 interferograms, and the hardware is awesome (128G ram).
However, step 6 took some seconds. Regarding step 5, I dont remember right now…
Is this ratio of processing time between Steps 3-4 and step 6 normal?

In addition, each step I started seperatly, with stamps(0,x) as x is the step number.
Until step 4, it always begun with
*** Step ‘this_step’ ***

From step 5, it always started from 4:
*** Step 4 *** - quick processing time of something
*** Step 5 ***

Step 6 started with
*** Step 4 ***

*** Step 5 ***

*** Step 6 ***

Is that normal?

Thank you all!

@Oded Jep, that is normal. RAM is not necessarily the bottleneck, lets say you have an i5 CPU with about 6 threads then you have 21G RAM per thread (lets assume OS does not count) I found that when using the implementation of StaMPS in Matlab, I could see an increase in performance from a 5G RAM / thread (32 G RAM in total) to 10G RAM / thread (64G RAM in total) but beyond, there was hardly no significant gain…so when you have 128G RAM I would suggest to try to use 12 threads (meaning two parallel i5 CPUs or simply better CPUs with more threads)…

Just to go sure: if you want to run step 5, you type stamps(5,5), not stamps(0,5)

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