insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
575 stars 252 forks source link

KeyError: `UTM_ZONE` while running hyp3 `MintPy_Time_Series_From_Prepared_Data_Stack` #1070

Closed Jichao96 closed 11 months ago

Jichao96 commented 1 year ago

Description of the problem

It seems that when defining the meta, there is no 'UTM_ZONE'

Full script that generated the error

PASTE CODE HERE

Full error message

PASTE ERROR MESSAGE HERE

Traceback (most recent call last): File "/root/tools/miniconda3/envs/insarenv/bin/smallbaselineApp.py", line 8, in sys.exit(main()) ^^^^^^ File "/root/tools/MintPy/src/mintpy/cli/smallbaselineApp.py", line 208, in main run_smallbaselineApp(inps) File "/root/tools/MintPy/src/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp app.run(steps=inps.runSteps) File "/root/tools/MintPy/src/mintpy/smallbaselineApp.py", line 874, in run self.run_load_data(sname) File "/root/tools/MintPy/src/mintpy/smallbaselineApp.py", line 176, in run_load_data mintpy.cli.load_data.main(iargs) File "/root/tools/MintPy/src/mintpy/cli/load_data.py", line 123, in main load_data(inps) File "/root/tools/MintPy/src/mintpy/load_data.py", line 784, in load_data prepare_metadata(iDict) File "/root/tools/MintPy/src/mintpy/load_data.py", line 633, in prepare_metadata prep_module.main(iargs) File "/root/tools/MintPy/src/mintpy/cli/prep_hyp3.py", line 94, in main prep_hyp3(inps) File "/root/tools/MintPy/src/mintpy/prep_hyp3.py", line 121, in prep_hyp3 meta = add_hyp3_metadata(fname, meta, is_ifg=is_ifg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/tools/MintPy/src/mintpy/prep_hyp3.py", line 61, in add_hyp3_metadata N, W = ut.utm2latlon(meta, W, N) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/tools/MintPy/src/mintpy/utils/utils0.py", line 319, in utm2latlon zone_num = int(meta['UTM_ZONE'][:-1])


KeyError: 'UTM_ZONE'

**System information**

* Operating system: <!-- macOS, Linux, Windows, etc. -->
* Python environment: <!-- conda, macports, pip, path setup, etc. -->
* MintPy version: <!-- output of `smallbaselineApp.py -v` -->
* Your custom / default template file (if the bug is related to a specific dataset): <!-- It helps the diagnose a lot if you could post the configurations you used. You can drag-and-drop them here directly. -->
welcome[bot] commented 1 year ago

👋 Thanks for opening your first issue here! Please filled out the template with as much details as possible. We appreciate that you took the time to contribute! Make sure you read our contributing guidelines.

yunjunz commented 1 year ago

This metadata has been introduced for a while now for hyp3. I recommend deleting all existing *.rsc files next to your tif files and running mintpy again.

If the error still persists, could you run the printout prep_hyp3.py command and fill out the detailed template content, so that I may be able to reproduce your error using the Ridgecrest example dataset?

saeid-aminjafari commented 1 year ago

If you are using OpenSARLab Jupyter notebook to prepare your Hyp3 stacks for Mintpy, you should remove the line below from the processing cell that crops the scene:

gdal.Warp(str(clip), str(clip), dstSRS='EPSG:4326', dstNodata=0)
surendarmrs commented 11 months ago

@saeid-aminjafari do you have any idea for the same problem in mintpy processing using Jupiter notebook? @yunjunz I am using gamma interferograms from ASF. I didn't see any .rsc files in that.

yunjunz commented 11 months ago

This problem is reproduced by a student in the EarthScope 2023 course. The solution from @saeid-aminjafari works.