Problem in mt_prep_snap

43 views
Skip to first unread message

Iling Yong

unread,
Mar 17, 2026, 2:13:34 PM (11 days ago) Mar 17
to MAINSAR
Dear All,

I am new to SNAP and StaMPS. I am trying to work out some output for the Mexico City. I did my snap2stamp-2.0.1. I successfully generated ifg and coreg and the StaMPS export. I have 8 SLC and formed 7 ifg pair. I confirm my AOI area is correct for all the ifg (I think so as when I open in SNAP, they show the same red rectangular box).
Screenshot 2026-03-17 110740.png
For the STAMPS export, I did have 4 folders as below.
iling@LAPTOP-N1FC2SLG:/mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930$ ls
dem  diff0  geo  rslc

However, when I run the mt_prep_snap, it show problem. all the mean amplitude is inf.
iling@LAPTOP-N1FC2SLG:/mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930$ mt_prep_snap 20180930 /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930 0.4 1 1 50 50
mt_prep_snap Andy Hooper, August 2017

Amplitude Dispersion Threshold: 0.4
Processing 1 patch(es) in range and 1 in azimuth

matlab: Command not found.
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6778651
Number of pixels with amplitude different than zero = 23867489
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180304.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6782419
Number of pixels with amplitude different than zero = 23863721
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180503.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6782430
Number of pixels with amplitude different than zero = 23863710
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180702.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6778235
Number of pixels with amplitude different than zero = 23867905
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180906.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6653799
Number of pixels with amplitude different than zero = 23992341
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180930.rslc...
WARNING : SLC /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180930.rslchas ZERO mean amplitude
Mean amplitude = 0
Number of pixels with zero amplitude = 30646140
Number of pixels with amplitude different than zero = 0
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20181105.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6654449
Number of pixels with amplitude different than zero = 23991691
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20190104.rslc...
Mean amplitude = inf
Number of pixels with zero amplitude = 6658124
Number of pixels with amplitude different than zero = 23988016
11140
2751
mt_extract_cands Andy Hooper, Jan 2007


Patch: PATCH_1
selpsc_patch /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/selpsc.in patch.in pscands.1.ij pscands.1.da mean_amp.flt f 1
file name for zero amplitude PS: pscands.1.ij0
dispersion threshold = 0.4
width = 11140
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/rslc/20180103.rslc...
number of amplitude files = 8
number of lines per file = 2751
patch lines = 2751
patch width = 11140
Segmentation fault (core dumped)

psclonlat /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/psclonlat.in pscands.1.ij pscands.1.ll
opening pscands.1.ij...
width = 11140
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/geo/20180930.lon...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/geo/20180930.lat...

pscdem /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/pscdem.in pscands.1.ij pscands.1.hgt
opening pscands.1.ij...
pscdem: width = 11140
pscdem: opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/geo/elevation_dem.rdc...
pscdem: input file specified as single precision

pscphase /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/pscphase.in pscands.1.ij pscands.1.ph
opening pscands.1.ij...
width = 11140
number of interferograms = 7
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20180103.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20180304.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20180503.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20180702.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20180906.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20181105.diff...
opening /mnt/c/Users/iling/Documents/MexicoCity/snap9/snap2stamps-2.0.1/INSAR_20180930/diff0/20180930_20190104.diff...
1 of 7 interferograms processed
2 of 7 interferograms processed
3 of 7 interferograms processed
4 of 7 interferograms processed
5 of 7 interferograms processed
6 of 7 interferograms processed
7 of 7 interferograms processed

I appreciate your help. Thank you. 

Regards,
Ai Ling

Nguyen Thi Minh Trang

unread,
Mar 18, 2026, 4:09:02 AM (10 days ago) Mar 18
to MAINSAR
Hi Ai Ling,

I've been where you are. I can tell you what worked for me.

A couple things I noticed:

1. Error: "matlab: Command not found."
> Probably indicates that your Matlab has not been correctly installed. Make sure you have it installed and have a working Matlab license/trial.

2. Error: "Segmentation fault (core dumped)."
> This error has been discussed on SNAP STEP forum. The solution is to recompile StaMPS using GNU Compiler Collection (GCC) version 7 (gcc-7). The SNAP STEP forum thread is here: https://forum.step.esa.int/t/segmentation-fault-core-dumped-error-during-mt-prep-snap/15615/17

3. "Mean amplitude = inf" and "Mean amplitude = 0"
> I had same problem, and in my case, it was due to a combination of Endianness mismatch + GCC compilation.
Basically, in this worklow, there are multiple softwares and OSs. They store, read, export data in different orders. For example, a value of 00000789 could have been read inversely as 98700000, which can make a small value look like it is a big (or even infinite) value.
Seeing that your mean amplitude value is either 0 or infinite, it could be the case. For me, recompiling GCC resolved this problem.

Note: Some of the errors you had might stem from preprocessing steps preceding mt_prep_snap. Make sure you check all of those steps as well.

To know what results to expect after each step, you can compare your results with the IGARSS 2021 tutorial here: https://youtube.com/playlist?list=PLSXfkgjVHNAb_H7TSpPMmoEdihZ06bkRL&si=5l0Bhb6fUes3VvZz

Would be useful:
Official snap2stamps GitHub page: https://github.com/mdelgadoblasco/snap2stamps

Good luck!
Trang

Iling Yong

unread,
Mar 19, 2026, 1:31:48 PM (9 days ago) Mar 19
to MAINSAR
Hi Trang,

Thank you for your suggestion. I am able to run this step now.
I change the SNAP 13 to SNAP 9, and use g++-7 and gcc-7 in ubuntu-20.04.
Screenshot 2026-03-18 203131.png
Thank you.

I am trying to follow the tutorial from IGARSS 2021 by Dr Dinh Ho Tong Minh. However, when I start the stamps(6,6) [unwrapping phase]. I realise that my code is different from Dr Dinh Ho Tong Minh. I get this line 'PS_UNWRAP: Windows detected: using old unwrapping code without statistical cost processing Triangulating...' and I suck at the unwrapping in space [I run almost 3-4hours but still running]. I get the 'uw_phase.mat' and 'uw_phase_time.mat', but not the unwrapping in space. 
Did you have experience on this? Here is my ps_info and parameter used.

>> ps_info [I checked this, should be reasonable, just the 37.997degree a bit big but still <40degree] --> I am trying to change the std dev to 0.8 to check any help in unwrapping phase
1 03-Jan-2018 -44 m 24.307 deg
2 04-Mar-2018 5 m 18.879 deg
3 03-May-2018 -51 m 21.363 deg
4 02-Jul-2018 -85 m 15.313 deg
5 06-Sep-2018 0 m 37.997 deg
6 30-Sep-2018 -26 m 22.160 deg
7 05-Nov-2018 -40 m 22.645 deg
8 04-Jan-2019 -20 m 23.289 deg
Number of stable-phase pixels: 4008525

>> getparm
Created: '18-Mar-2026'
clap_alpha: 1
clap_beta: 0.3000
clap_low_pass_wavelength: 800
clap_win: 32
density_rand: 20
drop_ifg_index: []
filter_grid_size: 50
filter_weighting: 'P-square'
gamma_change_convergence: 0.0050
gamma_max_iterations: 3
gamma_stdev_reject: 0
heading: 190.4638
insar_processor: 'snap'
lambda: 0.0555
lonlat_offset: [0 0]
max_topo_err: 20
merge_resample_size: 0
merge_standard_dev: Inf
n_cores: 1
percent_rand: 20
platform: 'SENTINEL-1B'
plot_color_scheme: 'inflation'
plot_dem_posting: 90
plot_pixels_scatterer: 3
plot_scatterer_size: 120
quick_est_gamma_flag: 'y'
ref_centre_lonlat: [0 0]
ref_lat: [-Inf Inf]
ref_lon: [-Inf Inf]
ref_radius: Inf
ref_velocity: 0
scla_deramp: 'n'
scla_drop_index: []
scla_method: 'L2'
scn_deramp_ifg: []
scn_kriging_flag: 'n'
scn_time_win: 365
scn_wavelength: 100
select_method: 'DENSITY'
select_reest_gamma_flag: 'y'
shade_rel_angle: [90 45]
slc_osf: 1
small_baseline_flag: 'n'
subtr_tropo: 'n'
tropo_method: 'a_l'
unwrap_alpha: 8
unwrap_gold_alpha: 0.8000
unwrap_gold_n_win: 32
unwrap_grid_size: 200
unwrap_hold_good_values: 'n'
unwrap_la_error_flag: 'y'
unwrap_method: '3D'
unwrap_patch_phase: 'n'
unwrap_prefilter_flag: 'y'
unwrap_spatial_cost_func_flag: 'n'
unwrap_time_win: 730
weed_max_noise: Inf
weed_neighbours: 'n'
weed_standard_dev: 1
weed_time_win: 730
weed_zero_elevation: 'n'

My code stopped here:
>> stamps(6,6)

STAMPS: ########################################
STAMPS: ####### StaMPS/MTI Version 4.0b6 #######
STAMPS: ####### Beta version, Jun 2018 #######
STAMPS: ########################################

STAMPS: Will process current directory only

STAMPS: ########################################
STAMPS: ################ Step 6 ################
STAMPS: ########################################
STAMPS: Directory is C:\Users\iling\Documents\MexicoCity\snap9\snap2stamps-2.0.1\INSAR_20180906

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.112425
PS_UNWRAP: Windows detected: using old unwrapping code without statistical cost processing --> this line did not shown in the youtube IGARSS 2021video
Triangulating...
Number of interferograms: 7
Number of points per ifg: 4008525

I appreciate your time and help. Thanks.

Nguyen Thi Minh Trang

unread,
Mar 23, 2026, 1:13:00 AM (5 days ago) Mar 23
to MAINSAR
Hi Ai Ling,

Nice to hear you've made progress!

I'm not familiar with the error you mentioned, but someone had a similar error here: https://forum.step.esa.int/t/stamps-error-mean-v-is-not-found/17169/7. Their fix is to add snaphu to path and run with a larger stack.

Do update us if you have an idea how to fix it in case someone run into the same problem!

Wishing you luck,
Trang
Reply all
Reply to author
Forward
0 new messages