Error when do the step of quick overview

245 views
Skip to first unread message

Yi-Chieh Lee

unread,
Sep 28, 2021, 12:49:11 PM9/28/21
to MintPy
Dear everyone,

I met some issues when I tried to do the step of 'quick overview' and the error message shows me: TypeError: Indexing arrays must have integer dtypes.
I removed the mintpy environment and re-installed it again before and it can work once. After that, I tried to modify the parameters in the config file and re-run the whole process. But it can't work again and always failed in the step of quick overview.
It seems like an issue about the h5py package, but both of the versions of the mintpy and h5py which I used are the followed the instructions on the github
I am not clear that is there any version problem or something I omitted and I hope this information will helpful. 

System information:
  • Python environment: Mintpy, ISCE
  • MintPy version: v1.3.1-1, release date 2021-08-03
  • Used InSAR Process: ISCE 
  • SAR sensor and imaging mode: Sentinel-1
Regards,
Yi-Chieh

Zhang Yunjun

unread,
Oct 2, 2021, 7:36:03 PM10/2/21
to MintPy
Hi Yi-Chieh,

It seems strange that it worked once but failed laterward. Is it possible you mixed different python environments and did not use the same one?

Yunjun

王嘉庚

unread,
Nov 19, 2021, 4:22:48 AM11/19/21
to MintPy
The issue caused due to the version of h5py. If its 3.0, the problem would appear.
try to check the h5py.__version

and use the command
conda install h5py=2.10.0

hope that works

Robert Zinke

unread,
Mar 1, 2023, 7:01:24 PM3/1/23
to MintPy
Hello,

I am getting a similar error:

```

unwrap_error_phase_closure.py /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/inputs/ifgramStack.h5 --water-mask /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/waterMask.h5 --action calculate --update

open ifgramStack file: ifgramStack.h5

number of interferograms: 812

number of triplets: 444

calculating the number of triplets with non-zero integer ambiguity of closure phase ...

    block by block with size up to (380, 750), 6 blocks in total

reference pixel in y/x: (286, 561) from dataset: unwrapPhase

[==================================================] line 1900 / 1915   16s /     3s

mask out pixels with zero in file: /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/waterMask.h5

mask out pixels with zero in file: /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/avgSpatialCoh.h5

write to file /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/numTriNonzeroIntAmbiguity.h5

create HDF5 file: /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/numTriNonzeroIntAmbiguity.h5 with w mode

create dataset /mask of float32    in size of (1915, 750)          with compression=None

finished writing to /data/Tibet/Track121/Timeseries/aoiB/9arc/mintpy/TS_SET_ERA5_demErr/numTriNonzeroIntAmbiguity.h5

Traceback (most recent call last):

  File "/home/rzinke/miniconda3/envs/insar/bin/smallbaselineApp.py", line 8, in <module>

    sys.exit(main())

  File "/home/rzinke/tools/MintPy/src/mintpy/cli/smallbaselineApp.py", line 208, in main

    run_smallbaselineApp(inps)

  File "/home/rzinke/tools/MintPy/src/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp

    app.run(steps=inps.runSteps)

  File "/home/rzinke/tools/MintPy/src/mintpy/smallbaselineApp.py", line 883, in run

    self.run_quick_overview(sname)

  File "/home/rzinke/tools/MintPy/src/mintpy/smallbaselineApp.py", line 330, in run_quick_overview

    mintpy.cli.unwrap_error_phase_closure.main(iargs)

  File "/home/rzinke/tools/MintPy/src/mintpy/cli/unwrap_error_phase_closure.py", line 153, in main

    run_unwrap_error_phase_closure(inps)

  File "/home/rzinke/tools/MintPy/src/mintpy/unwrap_error_phase_closure.py", line 426, in run_unwrap_error_phase_closure

    out_file = calc_num_triplet_with_nonzero_integer_ambiguity(

  File "/home/rzinke/tools/MintPy/src/mintpy/unwrap_error_phase_closure.py", line 186, in calc_num_triplet_with_nonzero_integer_ambiguity

    pp.plot_num_triplet_with_nonzero_integer_ambiguity(out_file)

  File "/home/rzinke/tools/MintPy/src/mintpy/utils/plot.py", line 968, in plot_num_triplet_with_nonzero_integer_ambiguity

    ax.hist(data[~np.isnan(data)].flatten(), range=(0, vmax), log=True, bins=vmax)

  File "/home/rzinke/miniconda3/envs/insar/lib/python3.10/site-packages/matplotlib/__init__.py", line 1442, in inner

    return func(ax, *map(sanitize_sequence, args), **kwargs)

  File "/home/rzinke/miniconda3/envs/insar/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 6790, in hist

    m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)

  File "<__array_function__ internals>", line 200, in histogram

  File "/home/rzinke/miniconda3/envs/insar/lib/python3.10/site-packages/numpy/lib/histograms.py", line 780, in histogram

    bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)

  File "/home/rzinke/miniconda3/envs/insar/lib/python3.10/site-packages/numpy/lib/histograms.py", line 424, in _get_bin_edges

    raise ValueError('`bins` must be positive, when an integer')

ValueError: `bins` must be positive, when an integer

```

Interestingly, the avgSptialCoh.h5 map is all 0, but the coherenceSpatialAvg.txt file shows valid Mean values (mostly > 0.7).
I cannot downgrade to h5py=2.10.0 due to conflicts.

Zhang Yunjun

unread,
Mar 3, 2023, 12:47:23 AM3/3/23
to MintPy
Hi Rob,

I guess the following chain leads to the error:
all zero in avgSpatialCoh.5h -----used as mask----> all zero in numTriNonzeroIntAmbiguity.h5 ------ 0 in vmax passed as bins for ax.hist().

Yeah, it's strange avgSpatialCoh.h5 (generated during reference_point step) is all zero, does the `coherence` dataset in ifgramStack.h5 look reasonable to you?

Yunjun
Reply all
Reply to author
Forward
0 new messages