HyP3_Velocity in KMZ format

211 views
Skip to first unread message

Sayyed Mohammad Javad Mirzadeh

unread,
Oct 30, 2021, 3:20:07 AM10/30/21
to MintPy
Hi Yunjun,

I finished the MintPy progress for both the Ridgecrest test case and also my study area, provided by the HyP3 service. When I tried to open and see the velocity map in KMZ format, I can see that there is a problem and it seems that it is invisible.
I guess that it is due to the UTM coordinates of velocity results and also the MintPy processing in the UTM environment. Is it right?

Sincerely,
Sayyed
velocity.kmz

Zhang Yunjun

unread,
Oct 30, 2021, 11:22:51 PM10/30/21
to MintPy
Hi Sayyed,

Yes, it's due to the UTM coordinates. save_kmz.py currently does not supported that, thus, the generated KMZ file is not right. Could you please open an github issue so that we could keep track of it?

Thank you,
Yunjun

Sayyed Mohammad Javad Mirzadeh

unread,
Nov 1, 2021, 10:51:09 PM11/1/21
to MintPy
Dear Yunjun,

Thank you for your reply.
Sure, I will open a GitHub issue.

Sincerely,
Sayyed



Hugo Luna Villavicencio

unread,
Sep 13, 2023, 12:08:23 AM9/13/23
to MintPy
Hello Yunjun and Sayyed

In order to get the speed values ​​in .kml format using hyp3, I have performed some extra steps. First cut the .tif image according to my study area and then change the SRC of the files to EPSG:4326, I did this in order to obtain the kml output file. But now when executing the smallbaselineApp.py command the following error occurs:

prepare metadata files for hyp3 products
prep_hyp3.py "../hyp3/*/*unw_phase_clip.tif"
/home/hugoluvi/miniconda3/envs/MintPy/lib/python3.9/site-packages/osgeo/gdal.py:287: FutureWarning: Neither gdal.UseExceptions() nor gdal.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.
  warnings.warn(
Traceback (most recent call last):
  File "/home/hugoluvi/miniconda3/envs/MintPy/bin/smallbaselineApp.py", line 8, in <module>
    sys.exit(main())
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/smallbaselineApp.py", line 874, in run
    self.run_load_data(sname)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/smallbaselineApp.py", line 176, in run_load_data
    mintpy.cli.load_data.main(iargs)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/cli/load_data.py", line 123, in main
    load_data(inps)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/load_data.py", line 784, in load_data
    prepare_metadata(iDict)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/load_data.py", line 633, in prepare_metadata prep_module.main(iargs)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/cli/prep_hyp3.py", line 94, in main
    prep_hyp3(inps)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/prep_hyp3.py", line 126, in prep_hyp3
    meta = add_hyp3_metadata(fname, meta, is_ifg=is_ifg)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/prep_hyp3.py", line 71, in add_hyp3_metadata
    N, W = ut.utm2latlon(meta, W, N)
  File "/home/hugoluvi/Documentos/GitHub/MintPy/src/mintpy/utils/utils0.py", line 319, in utm2latlon
    zone_num = int(meta['UTM_ZONE'][:-1])
KeyError: 'UTM_ZONE'



I guess I have to make other changes to the codes, but I don't know where

Thank you very much for your comments

Sayyed Mohammad Javad Mirzadeh

unread,
Sep 13, 2023, 8:34:36 AM9/13/23
to MintPy
Hi Hugo,

Regarding the HyP3 products with the MintPy, I changed the cutGeotiff.py a little bit to change the coordinate system of inputs Geotiff files from UTM to WGS84 and then, go through the MintPy steps easily. Then, I do not need to worry about the additional steps to convert the outputs from the MintPy.

Sincerely,
Sayyed



Hugo Luna Villavicencio

unread,
Sep 13, 2023, 11:17:54 AM9/13/23
to min...@googlegroups.com
Thanks for replying Sayyed. 

Do you have any idea why the error I mentioned above occurs? The error talks about:
 KeyError: 'UTM_ZONE'.

--
You received this message because you are subscribed to the Google Groups "MintPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mintpy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mintpy/ce871cdc-99f4-47b4-8b4d-962c0c20a8b7n%40googlegroups.com.

Sayyed Mohammad Javad Mirzadeh

unread,
Sep 13, 2023, 11:30:24 AM9/13/23
to MintPy
It seems that MintPy is trying to find the "UTM_Zone" property in the metadata of your input files but it failed. I think it can be good to go through the way I suggested.

Hugo Luna Villavicencio

unread,
Sep 13, 2023, 12:20:44 PM9/13/23
to min...@googlegroups.com
Thank you very much, Sayyed for your response

Maybe I got a little confused, Did you make modifications to the cutGeotiff.py code?
If so, could you show what changes you made?



--
A T E N T A M E N T E :

M. en I. C. HUGO LUNA VILLAVICENCIO

Sayyed Mohammad Javad Mirzadeh

unread,
Sep 13, 2023, 9:43:40 PM9/13/23
to MintPy
Welcome. Yes, I just added two lines in the "cutGeotiff.py" code from hyp3-lib to crop all input Geotiff files to the same extend and also convert them from UTM to the WGS84 coordinate system.
If you like to mention your email address here, I will send it to you by email with description about what you should do to use it.

Sincerely,
Sayyed

Hugo Luna Villavicencio

unread,
Sep 13, 2023, 10:09:10 PM9/13/23
to min...@googlegroups.com
Thank you very much Sayyed, my email is inghugolunav...@gmail.com

Esubalew Adem

unread,
May 16, 2024, 4:56:07 AMMay 16
to MintPy
Dear Sayyed Mohammad,

I have the same issue with the problem of opening velocity.kmz in Google Earth. 

I used HyP3 + Mintpy in OpenSarLab 

Could you please send me the two lines to be added to cutGeotiff.py" code to convert from UTM to the WGS84?  

email :   yib...@gmail.com

Sayyed Mohammad Javad Mirzadeh

unread,
May 16, 2024, 8:09:52 PMMay 16
to MintPy
Hi Esubalew,

Thank you for your message.
Sorry, I cannot see your email address correctly. Could you please send me an email directly?

Sincerely,
Sayyed



Reply all
Reply to author
Forward
0 new messages