Error in Correct Troposphere step

159 views
Skip to first unread message

engelb...@gmail.com

unread,
Oct 8, 2021, 12:27:55 PM10/8/21
to MintPy
Dear Yunjun,

I hope you are well. I am experiencing problems in the the execution of the step "Correct_toposphere". The reanalysis dataset is ERA5 which appers to be downloading correctly. The program fails with a KeyError: 'Y_UNIT'. I add the error details below. The interferograms are Sentinel-1 scenes with preprocessing in SNAP. Any guidance would be appreciated.

******************** step - correct_troposphere ********************
Input data seems to be geocoded. Lookup file not needed.
Atmospheric correction using Weather Re-analysis dataset (PyAPS, Jolivet et al., 2011)
Weather Re-analysis dataset: ERA5

tropo_pyaps3.py -f /home/jengelbrecht/working/EB_S1_mintpy/AOI1_3/timeseries.h5 --model ERA5 -g /home/jengelbrecht/working/EB_S1_mintpy/AOI1_3/inputs/geometryGeo.h5 -w /home/jengelbrecht/weather_data/
weather model: ERA5 - dry (hydrostatic) and wet delay
weather directory: /home/jengelbrecht/weather_data
output tropospheric delay file: /home/jengelbrecht/working/EB_S1_mintpy/AOI1_3/inputs/ERA5.h5
output corrected time-series file: /home/jengelbrecht/working/EB_S1_mintpy/AOI1_3/timeseries_ERA5.h5
read dates/time info from file: /home/jengelbrecht/working/EB_S1_mintpy/AOI1_3/timeseries.h5
time of cloest available product: 23:00 UTC
Traceback (most recent call last):
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1256, in <module>
    main(sys.argv[1:])
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1238, in main
    app.run(steps=inps.runSteps)
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1053, in run
    self.run_tropospheric_delay_correction(sname)
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 809, in run_tropospheric_delay_correction
    tropo_pyaps3.main(iargs)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 784, in main
    get_grib_info(inps)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 266, in get_grib_info
    inps.snwe = get_snwe(inps.atr, geom_file=inps.geom_file)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 393, in get_snwe
    lat0, lat1, lon0, lon1 = get_bounding_box(meta, geom_file=geom_file)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 457, in get_bounding_box
    if not meta['Y_UNIT'].lower().startswith('deg'):
KeyError: 'Y_UNIT'

All the best,

Jeanine

Zhang Yunjun

unread,
Oct 8, 2021, 4:31:29 PM10/8/21
to MintPy
Hi Jeanine,

This bug has been reported and fixed. 

Cheers,
Yunjun

engelb...@gmail.com

unread,
Oct 12, 2021, 4:58:02 PM10/12/21
to MintPy
Wonderful, thank you Yunjun, I have updated the installation and the ERA5.h5 input is now successfully created. However, the process now get's stuck on calculating the absolute delay.  The interferograms are Sentinel-1 scenes with preprocessing in SNAP.  The error is detailed below. I would appreciate any additional guidance.

--------------------------------------------------
create HDF5 file: /home/jengelbrecht/working/EB_S1_mintpy/AOI1_test3/inputs/ERA5.h5 with w mode
create dataset  : date       of |S8                       in size of (34,)                with compression = None
create dataset  : timeseries of <class 'numpy.float32'>   in size of (34, 902, 934)       with compression = None
close  HDF5 file: /home/jengelbrecht/working/EB_S1_mintpy/AOI1_test3/inputs/ERA5.h5

------------------------------------------------------------------------------
calculating absolute delay for each date using PyAPS (Jolivet et al., 2011; 2014) ...
number of grib files used: 34
Traceback (most recent call last):
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1281, in <module>
    main(sys.argv[1:])
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1263, in main
    app.run(steps=inps.runSteps)
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 1054, in run
    self.run_tropospheric_delay_correction(sname)
  File "/home/jengelbrecht/MintPy/mintpy/smallbaselineApp.py", line 810, in run_tropospheric_delay_correction
    tropo_pyaps3.main(iargs)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 841, in main
    calc_delay_timeseries(inps)
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 769, in calc_delay_timeseries
    tropo_data = get_delay(grib_file,
  File "/home/jengelbrecht/MintPy/mintpy/tropo_pyaps3.py", line 636, in get_delay
    aps_obj = pa.PyAPS(grib_file,
  File "/home/jengelbrecht/PyAPS/pyaps3/objects.py", line 121, in __init__
    self.minlon = np.nanmin(self.lon[np.nonzero(self.mask)]) - self.bufspc
  File "<__array_function__ internals>", line 5, in nanmin
  File "/home/jengelbrecht/miniconda3/lib/python3.8/site-packages/numpy/lib/nanfunctions.py", line 319, in nanmin
    res = np.fmin.reduce(a, axis=axis, out=out, **kwargs)
ValueError: zero-size array to reduction operation fmin which has no identity

Zhang Yunjun

unread,
Oct 20, 2021, 1:43:40 AM10/20/21
to MintPy
Hi Jeanine,

Hmm..., I can not see the cause from your error message above. 

If you could send me (yunju...@gmail.com) the "inputs/geometryGeo.h5" and "timeseries.h5" files, I could take a further look. 

Yunjun

Emre baydoğan

unread,
Sep 7, 2025, 3:21:36 PM (3 days ago) Sep 7
to MintPy
hi everyone, ı have a problem. how can ı solve this problem ? 

resim_2025-09-07_222013028.png

20 Ekim 2021 Çarşamba tarihinde saat 08:43:40 UTC+3 itibarıyla Zhang Yunjun şunları yazdı:

Emre Havazlı

unread,
Sep 8, 2025, 11:56:13 AM (2 days ago) Sep 8
to MintPy
Hi Emre,

Please delete your ERA5.h5 file and try running the tropospheric correction again. 
It looks like the ERA5.h5 is empty, please ensure the corrections are downloaded and written to the file without an issue.

Kolay gelsin
Emre Havazli

Reply all
Reply to author
Forward
0 new messages