StaMPS error mean_v is not found

Hello!

I am running Radarsat-2 data through StaMPS (Windows machine, pre-processing in SNAP 7.0). The pre-processing workflow is as follows:

Band-Select --> Stack --> Terrain-Correction --> Output: Terrain Corrected Stack
Stack (not Terrain Corrected) --> Interferogram and Topo Phase Removal --> Terrain-Correction --> Add lat/lon bands using band math --> Output: Terrain Corrected Interferogram Stack with Lat/Long bands

Then, I export the outputs to StaMPS. All the pre-processing is done in gpt.

Unfortunately, after the StaMPS processing finishes, I get an error that says Error using load ‘mean_v’ is not found in the current folder.

I went through all the intermediate products to make sure that there were no errors in the input data and I found the triangles that form due to a low resolution of the DEM, so I increased the percent tile overlap and those went away. Then, I tried to not Terrain Correct to make sure that the Terrain Correction wasn’t causing the problem, and I still get the same error. To test if it was a data volume issue, I used a large stack >20 scenes, a small one with 6 scenes, and a medium sized one with 12 scenes, all with the same result. I also geographically subset a large stack to see if it was an issue with geographic extent (perhaps too many scatterers?).

Does anyone have any recommendations on how I may be able to tackle this?

Thank you!!
Sasha

Edit: I am using the latest version of StaMPS: https://github.com/dbekaert/StaMPS/releases/tag/v4.1-beta

have you tried to select the “output lat/lon band” in the interferogram generation step already (instead of TC)?

Yep! I get the same error.

I am re-running all my pre-processing in the GUI without TC, and I have gotten a new error (progress!) in Stamps Step 6:

Index exceeds the number of array elements (6).

Error in uw_unwrap_time (line 49)
dph_close_master=mean(dph_smooth_uw(close_master_ix));

Error in uw_nosnaphu (line 10)
uw_unwrap_time(options.time_win)

Error in ps_unwrap (line 238)
[ph_uw_some]=uw_nosnaphu(ph_w(:,unwrap_ifg_index),ps.xy,day,options);

Error in stamps (line 507)
ps_unwrap

This is what my inputs into stamps export look like.


have you tried in your command line if snaphu is installed correctly and can be called?

1 Like

So I didn’t have it in my path before, but I’ve added it to the path and made sure that snaphu can be called from the command line. I am still getting the same error though.

STAMPS: ########################################
STAMPS: ################ Step 6 ################
STAMPS: ########################################
STAMPS: Directory is D:\AltBox\2_Python\AltBox_01Aug2019\working\SlaveLake_test\stamps

PS_UNWRAP: Starting
Phase-unwrapping…
GETPARM: small_baseline_flag=‘n’
GETPARM: unwrap_patch_phase=‘n’
GETPARM: scla_deramp=‘n’
GETPARM: subtr_tropo=‘n’
GETPARM: tropo_method=‘a_l’
GETPARM: drop_ifg_index=
GETPARM: unwrap_hold_good_values=‘n’
PS_UNWRAP: Code to hold good values skipped
GETPARM: unwrap_time_win=730
GETPARM: unwrap_method=‘3D’
GETPARM: unwrap_grid_size=200
GETPARM: unwrap_gold_n_win=32
GETPARM: unwrap_prefilter_flag=‘y’
GETPARM: unwrap_gold_alpha=0.8
GETPARM: unwrap_la_error_flag=‘y’
GETPARM: unwrap_spatial_cost_func_flag=‘n’
GETPARM: max_topo_err=20
GETPARM: lambda=0.0554658
PS_UNWRAP: n_trial_wraps=0.516045
PS_UNWRAP: Windows detected: using old unwrapping code without statistical cost processing

ans =

'This is unwrap_ifg_index'

unwrap_ifg_index =

 1     2     3     4     5     7

Triangulating…
Number of interferograms: 6
Number of points per ifg: 2512
Unwrapping in time…
Index exceeds the number of array elements (6).

Error in uw_unwrap_time (line 49)
dph_close_master=mean(dph_smooth_uw(close_master_ix));

Error in uw_nosnaphu (line 10)
uw_unwrap_time(options.time_win)

Error in ps_unwrap (line 240)
[ph_uw_some]=uw_nosnaphu(ph_w(:,unwrap_ifg_index),ps.xy,day,options);

Error in stamps (line 507)
ps_unwrap

If I change unwrap_ifg_index to [1 2 3 4 5 6] I still get the same error.

Edit: I changed out day=ps.day-ps.master_day to day=ps.day(unwrap_ifg_index)-ps.master_day in line 227 of ps_unwrap.m and that seems to work! However, I am getting a Warning:

Warning: Rank deficient, rank = 2510, tol = 1.393917e-10.

In uw_unwrap_space (line 77)
In uw_nosnaphu (line 11)
In ps_unwrap (line 242)
In stamps (line 507)

I just wanted to update, everything works great. The issue was me not adding snaphu to my path. I’ve ran the program with a larger stack and I don’t get the rank deficiency warning anymore either. Thank you!