insarlab / MintPy

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

SET not working on HyP3 products due to missing azimuth angle file #575

Closed bjmarfito closed 3 years ago

bjmarfito commented 3 years ago

Description of the problem I am generating time-series from HyP3 interferograms and was trying to correct for solid earth tides. However, the azimuthAngle file is missing from the geometryGeo.h5 since the azimuth file is not included on the HyP3. Though, the geometryGeo.h5 has a heading value.

I'm thinking if I should also inform the HyP3 team regarding this issue.

Full script that generated the error

smallbaselineApp.py 2019_Cotabato.cfg

Full error message

******************** step - correct_SET ********************
Input data seems to be geocoded. Lookup file not needed.

solid_earth_tides.py /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/timeseries.h5 -g /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5 -o /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/timeseries_SET.h5 --update
read/prepare LOS geometry from file: /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5
read incidence / azimuth angle
Traceback (most recent call last):
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1255, in <module>
    main(sys.argv[1:])
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1237, in main
    app.run(steps=inps.runSteps)
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1050, in run
    self.run_solid_earth_tides_correction(sname)
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 742, in run_solid_earth_tides_correction
    solid_earth_tides.main(iargs)
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 341, in main
    calc_solid_earth_tides_timeseries(ts_file=inps.dis_file,
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 248, in calc_solid_earth_tides_timeseries
    inc_angle, head_angle, atr_geo = prepare_los_geometry(geom_file)
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 129, in prepare_los_geometry
    az_angle  = readfile.read(geom_file, datasetName='azimuthAngle')[0]
  File "/Users/bryanmarfito/MintPy/mintpy/utils/readfile.py", line 222, in read
    data = read_hdf5_file(fname,
  File "/Users/bryanmarfito/MintPy/mintpy/utils/readfile.py", line 292, in read_hdf5_file
    raise ValueError('input dataset {} not found in file {}'.format(datasetName, fname))
ValueError: input dataset ['azimuthAngle'] not found in file /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5

System information

yunjunz commented 3 years ago

Thank you @bjmarfito for reporting this issue. I agree that it will be useful if HyP3 has the pixel-wised azimuth angle file. In addition, mintpy could use the less accurate but still acceptable mean value from the HEADING attribute.

bjmarfito commented 3 years ago

@yunjunz, I've updated my MintPy and processed HyP3 images with SET enabled. A new error came up.

******************** step - correct_SET ********************
Input data seems to be geocoded. Lookup file not needed.

solid_earth_tides.py /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/timeseries.h5 -g /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5 -o /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/timeseries_SET.h5 --update
prepare LOS geometry in geo-coordinates from file: /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5
read incidenceAngle from file: /Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/inputs/geometryGeo.h5
use the HEADING attribute as the mean heading angle

prepare datetime info for each acquisition
Use the same time of the day for all acquisitions from CENTER_LINE_UTC
With <= 1 min variation for Sentinel-1A/B for example, this simplication has negligible impact on SET calculation.

--------------------------------------------------
calculating solid Earth tides using solid.for (D. Milbert, 2018) ...
Check arguments.
Check arguments.
/Users/bryanmarfito/miniconda3/envs/mintpy/lib/python3.8/site-packages/pysolid/grid.py:95: UserWarning: loadtxt: Empty input file: "/Volumes/BJM_Personal/Cotabato_EQ_2019/Sentinel-1/HyP3/mintpy/solid.txt"
  fc = np.loadtxt(txt_file,
Traceback (most recent call last):
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1256, in <module>
    main(sys.argv[1:])
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1238, in main
    app.run(steps=inps.runSteps)
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 1050, in run
    self.run_solid_earth_tides_correction(sname)
  File "/Users/bryanmarfito/MintPy/mintpy/smallbaselineApp.py", line 742, in run_solid_earth_tides_correction
    solid_earth_tides.main(iargs)
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 346, in main
    calc_solid_earth_tides_timeseries(
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 280, in calc_solid_earth_tides_timeseries
    tide_u) = pysolid.calc_solid_earth_tides_grid(dt_obj, atr_geo,
  File "/Users/bryanmarfito/miniconda3/envs/mintpy/lib/python3.8/site-packages/pysolid/grid.py", line 101, in calc_solid_earth_tides_grid
    tide_e = fc[:, 0].reshape(length, width)
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
yunjunz commented 3 years ago

Hi @bjmarfito, I don't enough test datasets to reproduce the error, would recommend debugging it yourself. Note that the hyp3 + mintpy workflow is not fully supported yet, so I won't be surprised to see many features not working.

bjmarfito commented 3 years ago

Noted on this @yunjunz. I'll debug it and will share the results if I'll be successful on it.