Error in SNAP - StaMPS processing of RS2 data: "Index in position 1 is invalid"

Well,

  1. remove the break point at the moment launching the function ps_est_gamma_quick
  2. run again without any breakpoint
  3. add new breakpoint on the exact line inside ps_est_gamma_quick which gives the error, so you will be able to get the actual value of the variables on the moment that they produce the error
1 Like

I followed exactly your points

image

I am sorry that I cannot express properly. I will try to give you some hints.
If you click on the 115 (in blue) it should bring you to the point where the code stops.
You should then try to figure out which values had the variables there involve, so you can identify which variables have the wrong values assigned, which should help you to identify what is wrong.

I am not sure how else I can help you. Let me know.

Cheers

It is Friday, you are explaining very nicely, this is the whole statement of the line 115, I’m not sure which one is wrong,

image

Hi @falahfakhri, did you find where the error was, and how to fix it? Beacause I am having the same problem in step2!
many thanks in advice

Yes! I have shared the script that solves the problem.
The trick is to find the wrong indexes during step 1, as the same way as Dr. Bekaert did, but also including 0s in addition to the NaNs.

You can find it here.

Let me know if this also solves the problem for you

4 Likes

Hello and thank you for sharing this script. For me, the new script introduces the following error in the same step of the StaMPS processing:
"
Index in position 2 is invalid. Array indices must be positive integers or logical values.

Error in clap_filt (line 71)
ph_bit(1:n_win,1:n_win)=ph(i1:i2,j1:j2);

Error in ps_est_gamma_quick (line 225)
ph_filt(:,:,i)=clap_filt(ph_grid(:,:,i),clap_alpha,clap_beta,n_win0.75,n_win0.25,low_pass);

Error in stamps (line 326)
ps_est_gamma_quick(est_gamma_parm);

"
in place of the one that occurred above for me. Is there anything that you could recommend as a next step to solving this? Please let me know if there is any other information that I can provide.

Thank you,

Thomas

You should re-run step1. Not sure you did it

I reran the processing from the beginning and the error no longer occurs. Thank you.

1 Like

There is on additional issue though. The processing now throws an error in step five:

"
STAMPS: ########################################
STAMPS: ################ Step 5 ################
STAMPS: ########################################
STAMPS: Directory is D:\test\r0\PATCH_1

PS_CORRECT_PHASE: Starting
Correcting phase for look angle error…
GETPARM: small_baseline_flag=‘n’
PS_CORRECT_PHASE: Finished
Error using movefile
The process cannot access the file because it is being used by another process.

Error in stamps (line 462)
movefile(‘patch.list’,‘patch.list_old’);"

Is there a recommended fix for this? I have noticed that this always occurs on the last patch being processed.

Thank you.

1 Like

I am not sure that this does not look as a StaMPS error… but something more system related.
Can you check about the involved files or permissions?

Before that step 5… what are the log of precedent steps for each PATCHes?
And… are you running StaMPS on Windows OS? Maybe it could be related to that. @Abraun, had you faced something similar?

not so far, sorry. I was always using Linux.

I am running StaMPS on Windows OS. I was able to get past step 5 by adding a few lines of code to stamps.m that checks for opened files and closes them before the calls to movefile(). I now am able to get to step 8, at which point in the script ps_scn_filt, the following error occurs:

"STAMPS: ########################################
STAMPS: ################ Step 8 ################
STAMPS: ########################################
STAMPS: Directory is D:\snap\for_snaphu\test_8_Mar5\r0

PS_SCN_FILT: Starting
Estimating other spatially-correlated noise…
GETPARM: unwrap_grid_size=200
GETPARM: scn_time_win=365
GETPARM: scn_deramp_ifg=
GETPARM: scn_wavelength=100
GETPARM: drop_ifg_index=
GETPARM: small_baseline_flag=‘n’
Number of points per ifg: 26384
‘triangle’ is not recognized as an internal or external command,
operable program or batch file.
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 32)
[tline,lt] = fgets(fid);

Error in ps_scn_filt (line 73)
header=str2num(fgetl(fid));

Error in stamps (line 545)
ps_scn_filt"

Looking at my working directory, there is no file by the name scnfilt.2.edge, which the script is looking for. Do you have any suggestions, or thoughts as to where something might have gone wrong?

Thank you.

2 Likes

I don’t know if this caused the error but shouldn’t triangle be compiled and available to matlab somehow?
On the other hand, you wouldn’t have gotten to step 8 if this was a problem…

1 Like

That is it. I just downloaded triangle (https://www.cs.cmu.edu/~quake/triangle.html) and compiled it for windows (https://stackoverflow.com/questions/16439654/how-can-i-compile-triangle-using-makefiles-on-a-windows-machine), and everything finishes. Thanks for all of the help!

1 Like

sounds good!

Did you also run the mt_prep_snap scripts under Windows?
Would be the first case (at least which I know) in which the whole processing chain technically works without errors outside Linux.

Yes, I ran mt_prep_snap, and everything else, under Windows 10. I had to install cygwin and ran it with tcsh. Thanks again.

2 Likes

good to hear, congratulations :wink:

it would be great if you can put up ur work as a step by step process as it would be much useful for the ones using stamps in windows and i am desperately waiting for it… Because i am so confused with stamps…

i have done stamps export in SNAP for PSI… and i dono how to proceed after this in windows… can you help me please…