insarlab / MintPy

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

HyP3+Mintpy+GACOS: Error in correct_troposphere with GACOS #1265

Open kiritofaker opened 2 months ago

kiritofaker commented 2 months ago

Description of the problem

An error occurred when I used Mintpy to do SBAS on the interferometric pairs derived from HyP3. But while executing the correct_troposphere step the following error is encountered. I downloaded the GACOS file with Binary grid format which is larger than range of cropped interferometric images to do the correct_troposphere.

Thank you!

Full script that generated the error

(insar) kirito@DESKTOP-QEL1OV1:~/test2/mintpy$ ls
data  gacos  smallbaselineApp.cfg
(insar) kirito@DESKTOP-QEL1OV1:~/test2/mintpy$ cd ..
(insar) kirito@DESKTOP-QEL1OV1:~/test2$ cd ..
(insar) kirito@DESKTOP-QEL1OV1:~$ cd test3/mintpy
(insar) kirito@DESKTOP-QEL1OV1:~/test3/mintpy$ smallbaselineApp.py smallbaselineApp.cfg

___________________________________________________________

  /##      /## /##             /##     /#######
 | ###    /###|__/            | ##    | ##__  ##
 | ####  /#### /## /#######  /######  | ##  \ ## /##   /##
 | ## ##/## ##| ##| ##__  ##|_  ##_/  | #######/| ##  | ##
 | ##  ###| ##| ##| ##  \ ##  | ##    | ##____/ | ##  | ##
 | ##\  # | ##| ##| ##  | ##  | ## /##| ##      | ##  | ##
 | ## \/  | ##| ##| ##  | ##  |  ####/| ##      |  #######
 |__/     |__/|__/|__/  |__/   \___/  |__/       \____  ##
                                                 /##  | ##
                                                |  ######/
   Miami InSAR Time-series software in Python    \______/
          MintPy 1.6.1.post1, 2024-08-11
___________________________________________________________

--RUN-at-2024-09-03 09:55:34.374252--
Current directory: /home/kirito/test3/mintpy
Run routine processing with smallbaselineApp.py on steps: ['load_data', 'modify_network', 'reference_point', 'quick_overview', 'correct_unwrap_error', 'invert_network', 'correct_LOD', 'correct_SET', 'correct_ionosphere', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']
Remaining steps: ['modify_network', 'reference_point', 'quick_overview', 'correct_unwrap_error', 'invert_network', 'correct_LOD', 'correct_SET', 'correct_ionosphere', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']
--------------------------------------------------
Go to work directory: /home/kirito/test3/mintpy
copy smallbaselineApp.cfg to inputs   directory for backup.
copy smallbaselineApp.cfg to pic      directory for backup.
read default template file: /home/kirito/test3/mintpy/smallbaselineApp.cfg

******************** step - correct_troposphere ********************
Input data seems to be geocoded. Lookup file not needed.
tropospheric delay correction with gacos approach

tropo_gacos.py -f /home/kirito/test3/mintpy/timeseries.h5 -g /home/kirito/test3/mintpy/inputs/geometryGeo.h5 -o /home/kirito/test3/mintpy/timeseries_GACOS.h5 --dir gacos
Use GACOS products at directory: /home/kirito/test3/mintpy/gacos
update mode: ON
output file: /home/kirito/test3/mintpy/inputs/GACOS.h5
1) output file either do NOT exist or is NOT newer than all ZTD files.
run or skip: run
--------------------------------------------------
create HDF5 file: /home/kirito/test3/mintpy/inputs/GACOS.h5 with w mode
create dataset  : date       of |S8                       in size of (31,)                with compression = None
create dataset  : timeseries of <class 'numpy.float32'>   in size of (31, 2813, 3177)     with compression = None
close  HDF5 file: /home/kirito/test3/mintpy/inputs/GACOS.h5
read incidenceAngle from file: /home/kirito/test3/mintpy/inputs/geometryGeo.h5
/home/kirito/mambaforge/envs/insar/lib/python3.12/site-packages/skimage/transform/_warps.py:202: RuntimeWarning: divide by zero encountered in scalar divide
  zoom_factors = [1 / f for f in factors]
/home/kirito/mambaforge/envs/insar/lib/python3.12/site-packages/scipy/ndimage/_interpolation.py:815: RuntimeWarning: invalid value encountered in scalar multiply
  [int(round(ii * jj)) for ii, jj in zip(input.shape, zoom)])

Full error message

Traceback (most recent call last):
  File "/home/kirito/mambaforge/envs/insar/bin/smallbaselineApp.py", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/kirito/MintPy/src/mintpy/cli/smallbaselineApp.py", line 209, in main
    run_smallbaselineApp(inps)
  File "/home/kirito/MintPy/src/mintpy/smallbaselineApp.py", line 1155, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/kirito/MintPy/src/mintpy/smallbaselineApp.py", line 935, in run
    self.run_tropospheric_delay_correction(sname)
  File "/home/kirito/MintPy/src/mintpy/smallbaselineApp.py", line 660, in run_tropospheric_delay_correction
    mintpy.cli.tropo_gacos.main(iargs)
  File "/home/kirito/MintPy/src/mintpy/cli/tropo_gacos.py", line 114, in main
    run_tropo_gacos(inps)
  File "/home/kirito/MintPy/src/mintpy/tropo_gacos.py", line 251, in run_tropo_gacos
    calculate_delay_timeseries(
  File "/home/kirito/MintPy/src/mintpy/tropo_gacos.py", line 226, in calculate_delay_timeseries
    delay = get_delay_geo(ztd_file, atr, cos_inc_angle)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kirito/MintPy/src/mintpy/tropo_gacos.py", line 43, in get_delay_geo
    delay = resize(
            ^^^^^^^
  File "/home/kirito/mambaforge/envs/insar/lib/python3.12/site-packages/skimage/transform/_warps.py", line 203, in resize
    out = ndi.zoom(
          ^^^^^^^^^
  File "/home/kirito/mambaforge/envs/insar/lib/python3.12/site-packages/scipy/ndimage/_interpolation.py", line 815, in zoom
    [int(round(ii * jj)) for ii, jj in zip(input.shape, zoom)])
         ^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer

System information

welcome[bot] commented 2 months 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 month ago

I don't think we support the gacos correction for hyp3 products yet. If you could provide an example dataset as below, here publicly or to me privately at yunjunz@outlook.com, I could add this support when I find time.

kiritofaker commented 4 weeks ago

Because the file size is so big, thus, i uploaded the necessary file to Baidu Netdisk, the file package includes timseries.h5, geometryGeo.h5 and GACOS data. the link is: https://pan.baidu.com/s/1iV45Szn4ncrgjY_ftzurVA?pwd=LMY1 code:LMY1 Thank for your help!