insarlab / MintPy

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

Error in SET corrections #566

Closed bjmarfito closed 3 years ago

bjmarfito commented 3 years ago

Description of the problem

When I'm running the smallbaselineApp.py and enabled correction for SET, an error message comes up indicating the 'CENTER_LINE_UTC' is not found. I've generated the stack using the alosStack processor from ISCE.

Full script that generated the error

(mintpy) bryanmarfito@Bryans-MacBook-Pro mintpy % smallbaselineApp.py

Full error message

******************** step - correct_SET ********************

solid_earth_tides.py /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries.h5 -g /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/geometryRadar.h5 -o /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries_SET.h5 --update
read/prepare LOS geometry from file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/geometryRadar.h5
read incidence / azimuth angle
--------------------------------------------------
geocoding the incidence / azimuth angle ...
resampling software: pyresample
read latitude / longitude from lookup table file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/geometryRadar.h5
output pixel size in (lat, lon) in degree: (-0.0007234363451723673, 0.0009108488135095427)
output area extent in (S, N, W, E) in degree: (5.374400816922629, 8.951070107454813, 124.49093098916747, 127.05405955038331)
output file row / column number: (4944, 2814)
searching relevant box covering the current SNWE
nearest resampling with pyresample.kd_tree using 1 CPU cores in 15 segments ...
nearest resampling with pyresample.kd_tree using 1 CPU cores in 15 segments ...

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) ...
[===============>        33%                       ] 2019-10-05T15:46:28 (1/3)  [======================= 67% =====>                ] 2019-10-19T15:46:28 (2/3)  [==================================================] 2019-11-02T15:46:28 (3/3)
radar-coding the LOS tides time-series ...
resampling software: pyresample
read latitude / longitude from lookup table file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/geometryRadar.h5
input pixel size in (lat, lon) in degree: [-0.0007234363451723673, 0.0009108488135095427]
input area extent in (S, N, W, E) in degree: (5.374400816922629, 8.951070107454813, 124.49093098916747, 127.05405955038331)
nearest resampling with pyresample.kd_tree using 1 CPU cores in 15 segments ...
create HDF5 file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/SET.h5 with w mode
create dataset /timeseries of float32    in size of (3, 4944, 2814)      with compression=None
create dataset /sensingMid of |S15       in size of (3,)                 with compression=None
create dataset /bperp      of float32    in size of (3,)       with compression=None
create dataset /date       of |S8        in size of (3,)       with compression=None
finished writing to /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/SET.h5

------------------------------------------------------------------------------
correcting relative delay for input time-series using diff.py
diff.py /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries.h5 /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/SET.h5 -o /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries_SET.h5
/Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries.h5 - ['/Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/inputs/SET.h5'] --> /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries_SET.h5
input files are: timeseries and timeseries
--------------------------------------------------
grab metadata from ref_file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries.h5
grab dataset structure from ref_file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries.h5
create HDF5 file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries_SET.h5 with w mode
create dataset  : bperp      of float32                   in size of (3,)                 with compression = None
create dataset  : date       of |S8                       in size of (3,)                 with compression = None
create dataset  : timeseries of float32                   in size of (3, 4944, 2814)      with compression = None
close  HDF5 file: /Volumes/BJM_WD_White/Mindanao/time-series/old/mintpy/timeseries_SET.h5
xmin
0
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 348, in main
    correct_timeseries(dis_file=inps.dis_file,
  File "/Users/bryanmarfito/MintPy/mintpy/solid_earth_tides.py", line 330, in correct_timeseries
    diff.main(iargs)
  File "/Users/bryanmarfito/MintPy/mintpy/diff.py", line 265, in main
    inps.outfile = diff_file(inps.file1, inps.file2, inps.outfile, force=inps.force)
  File "/Users/bryanmarfito/MintPy/mintpy/diff.py", line 167, in diff_file
    ref_val = readfile.read(file2[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 260, in read_hdf5_file
    slice_list = get_slice_list(fname)
  File "/Users/bryanmarfito/MintPy/mintpy/utils/readfile.py", line 562, in get_slice_list
    obj.open(print_msg=False)
  File "/Users/bryanmarfito/MintPy/mintpy/objects/stack.py", line 185, in open
    utc_sec = float(self.metadata['CENTER_LINE_UTC'])
KeyError: 'CENTER_LINE_UTC'

System information

yunjunz commented 3 years ago

Hi @bjmarfito, I can not think of anything on top of my head for this. The error just says that attribute is missing in the SET.h5 file, you might want to check and dig more on that. Please also make sure you have the isce>2.5 and mintpy installed in one env while running.

The following two options in your template file is not needed or not right, but I am not sure if that relates to the error somehow.

  1. mintpy.load.az/rgOffFile is not needed for InSAR time series, I would not mix them (load both offsets and interferograms).
  2. your mintpy.load.azAngleFile value should be the los file.
bjmarfito commented 3 years ago

Thank you @yunjunz for replying. I've followed your suggestions and still the error persisted on ALOS-2 stacks. I've run SET on Sentinel-1 stacks generated from topsStack and it worked. The CENTER_LINE_UTC is not present on the geometryRadar.h5 though it is present on the timeseries.h5.

I'll generate a PR regarding this to provide possible solution. I got the idea on the tropo_pyap3 where the CENTER_LINE_UTC is read from the timeseries.h5 instead of the geometryRadar.h5.