Skip to content

save_kmz.py for wrapped ISCE2 interferogram #1266

@tshreve

Description

@tshreve

Hi, I've found save_kmz.py very useful to quickly visualize in Google Earth a geocoded, wrapped interferogram processed with ISCE2. However, I've been running:

save_kmz.py filt_topophase.flat.geo --wrap --zero-mask --unit rad

and receiving the following error message:

data   coverage in y/x: (0, 0, 5887, 6068)
subset coverage in y/x: (0, 0, 5887, 6068)
update LENGTH, WIDTH, Y/XMAX
update/add SUBSET_XMIN/YMIN/XMAX/YMAX: 0/0/5887/6068
update Y/X_FIRST
masking out pixels with zero value
Traceback (most recent call last):
  File "/home/tshreve/anaconda3/envs/isce2env/bin/save_kmz.py", line 10, in <module>
    sys.exit(main())
  File "/home/tshreve/anaconda3/envs/isce2env/lib/python3.8/site-packages/mintpy/cli/save_kmz.py", line 150, in main
    save_kmz(inps)
  File "/home/tshreve/anaconda3/envs/isce2env/lib/python3.8/site-packages/mintpy/save_kmz.py", line 462, in save_kmz
    data, inps.disp_unit, inps.disp_scale, inps.wrap = pp.scale_data4disp_unit_and_rewrap(
  File "/home/tshreve/anaconda3/envs/isce2env/lib/python3.8/site-packages/mintpy/utils/plot.py", line 1770, in scale_data4disp_unit_and_rewrap
    data, disp_unit, disp_scale = scale_data2disp_unit(
  File "/home/tshreve/anaconda3/envs/isce2env/lib/python3.8/site-packages/mintpy/utils/plot.py", line 1686, in scale_data2disp_unit
    phase2range = -float(metadata['WAVELENGTH']) / (4*np.pi)
KeyError: 'WAVELENGTH'

I fixed this issue by modifying plot.py to not calculate phase2range if data_unit and disp_unit are both 'radian'. Happy to share this mod, but was first wondering if there is already a built-in fix. Thanks in advance!

System information

  • Operating system: Windows machine running WSL (Ubuntu 22.04.4 LTS (GNU/Linux 5.15.146.1-microsoft-standard-WSL2 x86_64))
  • Python environment: conda
  • MintPy version: MintPy version 1.6.1, date 2024-07-31
  • InSAR processor/product: isce2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions