Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view.py fails when using large multilook factor #950

Closed
EJFielding opened this issue Jan 27, 2023 · 4 comments · Fixed by #956
Closed

view.py fails when using large multilook factor #950

EJFielding opened this issue Jan 27, 2023 · 4 comments · Fixed by #956
Labels

Comments

@EJFielding
Copy link

Description of the problem

The view.py script is not correctly adjusting the location of the reference point when large multilooking factor is used for the display and then fails when original location is outside the multilooked image.

Full script that generated the error

view.py inputs/ifgramStack.h5 unwrapPhase --save

Full error message

run view.py in MintPy version 1.5.1.post6, date 2023-01-22
input file is ifgramStack file: /u/sar-r0/fielding/Calif/SF_Bay/UAVSAR/Stacks/Haywrd_15302_03/s4/MintPy/inputs/ifgramStack.h5 in float32 format
file size in y/x: (7345, 4950)
input dataset: "['unwrapPhase']"
num of datasets in file ifgramStack.h5: 330
num of datasets to exclude: 0
num of datasets to display: 198
data   coverage in y/x: (0, 0, 4950, 7345)
subset coverage in y/x: (0, 0, 4950, 7345)
data   coverage in lat/lon: None
subset coverage in lat/lon: None
------------------------------------------------------------------------
colormap: jet
figure title: unwrapPhase
figure size : [15.00, 8.00]
dataset number: 198
row     number: 6
column  number: 17
figure  number: 2
total number of pixels: 3.7E+09
* multilook 12 by 12 with nearest interpolation for display to save memory
consider reference pixel in y/x: [200, 1800]
mark interferograms with 'dropIfgram=False' in red colored title
----------------------------------------
Figure 1 - unwrapPhase_1.png
reading data as a list of 2D matrices ...
Traceback (most recent call last):
  File "/u/vento-r0/ericf/packages/Anaconda/anaconda3/envs/insar2022/bin/view.py", line 8, in <module>
    sys.exit(main())
  File "/u/pez-z2/fielding/tools/MintPy/src/mintpy/cli/view.py", line 172, in main
    obj.plot()
  File "/u/pez-z2/fielding/tools/MintPy/src/mintpy/view.py", line 1611, in plot
    plot_figure(j, self, metadata=self.atr)
  File "/u/pez-z2/fielding/tools/MintPy/src/mintpy/view.py", line 1286, in plot_figure
    data = read_data4figure(i_start, i_end, inps, metadata)
  File "/u/pez-z2/fielding/tools/MintPy/src/mintpy/view.py", line 1074, in read_data4figure
    d[d!=0] -= d[ref_y, ref_x]
IndexError: index 1800 is out of bounds for axis 1 with size 412

System information

  • Operating system: Linux-CentOS
  • Python environment: conda
  • MintPy version: MintPy version 1.5.1.post6, date 2023-01-22
  • Your custom / default template file (if the bug is related to a specific dataset):
@EJFielding
Copy link
Author

EJFielding commented Jan 27, 2023

It seems that view.py is trying to be helpful and taking the input dataset that I specified and displaying all datasets that start with that. In this case, I specifed unwrapPhase and it seems to be displaying all three datasets that start with "unwrapPhase". This is helpful if I want to save time and get the "coherence" by specifying only coh, but displaying all three "unwrapPhase" datasets is not so helpful. This is what leads it to use the high multilooking factor that causes the bug above.
This is the iinfo.py inputs/ifgramStack.h5 output for the stack:

HDF5 dataset "/bperp                             ": shape=(66,)               , dtype=float32   , compression=None
HDF5 dataset "/coherence                         ": shape=(66, 7345, 4950)    , dtype=float32   , compression=None
  MODIFICATION_TIME    1674841222.263768
HDF5 dataset "/connectComponent                  ": shape=(66, 7345, 4950)    , dtype=int16     , compression=lzf
  MODIFICATION_TIME    1674841223.2663143
HDF5 dataset "/date                              ": shape=(66, 2)             , dtype=|S8       , compression=None
HDF5 dataset "/dropIfgram                        ": shape=(66,)               , dtype=bool      , compression=None
HDF5 dataset "/unwrapPhase                       ": shape=(66, 7345, 4950)    , dtype=float32   , compression=None
  MODIFICATION_TIME    1674841221.262276
HDF5 dataset "/unwrapPhase_bridging              ": shape=(66, 7345, 4950)    , dtype=float32   , compression=None
  MODIFICATION_TIME    1674844729.352732
HDF5 dataset "/unwrapPhase_bridging_phaseClosure ": shape=(66, 7345, 4950)    , dtype=float32   , compression=None
  MODIFICATION_TIME    1674845481.476522

I see now that there is the unwrapPhase- option to get only the "unwrapPhase" dataset in the view.py help.

@yunjunz
Copy link
Member

yunjunz commented Feb 9, 2023

Thank you @EJFielding for reporting this bug, it is rare. The PR above should fix it, could you confirm? I did not reproduce your error.

@yunjunz
Copy link
Member

yunjunz commented Feb 15, 2023

I am able to re-produce the error and confirm the PR fixes it. Close the issue.

@yunjunz yunjunz closed this as completed Feb 15, 2023
@EJFielding
Copy link
Author

Thanks @yunjunz for fixing the bug and confirming the PR fixes it. I have been overwhelmed with the earthquake response so I did not have a chance to try it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants