Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mintpy Ver 1.5.1: KeyERROR "StartingRANGE" still persists. #967

Closed
lincoln-olayta opened this issue Mar 3, 2023 · 4 comments
Closed

Mintpy Ver 1.5.1: KeyERROR "StartingRANGE" still persists. #967

lincoln-olayta opened this issue Mar 3, 2023 · 4 comments

Comments

@lincoln-olayta
Copy link

Hi, I've recently installed mintpy to process results from stacking using ISCE for Sentinel-1.

I've installed the MintPy using conda (conda install -c conda-forge mintpy) in a new environment (without any isce), and I've tried running an initially using "smallbaselineApp.py smallbaselineApp.cfg --dostep load_data"

Right away, I've encountered an error very similar to the reported closed issue #927.
Here's the error:

MintPy version 1.5.1, date 2023-01-03
--RUN-at-2023-03-03 18:09:54.386611--
Current directory: /mnt/e/StackSentinel_Run/DES_2019
Run routine processing with smallbaselineApp.py on steps: ['load_data']
Remaining steps: ['modify_network', 'reference_point', 'quick_overview', 'correct_unwrap_error', 'invert_network', 'correct_LOD', 'correct_SET', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']
--------------------------------------------------
Go to work directory: /mnt/e/StackSentinel_Run/DES_2019
copy smallbaselineApp.cfg to inputs   directory for backup.
copy smallbaselineApp.cfg to pic      directory for backup.
read default template file: /mnt/e/StackSentinel_Run/DES_2019/smallbaselineApp.cfg


******************** step - load_data ********************

load_data.py --template /mnt/e/StackSentinel_Run/DES_2019/smallbaselineApp.cfg
processor : isce
SAR platform/sensor : unknown from project name "None"
--------------------------------------------------
prepare metadata files for isce products
prep_isce.py -m ./reference/IW2.xml -g ./merged/geom_reference -b ./baselines -f "./merged/interferograms/*/filt_*.unw" --geom-files hgt.rdr lat.rdr lon.rdr los.rdr los.rdr shadowMask.rdr
extract metadata from ISCE/topsStack xml file: ./reference/IW2.xml
/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/load_data.py:680: UserWarning: prep_isce.py failed. Assuming its result exists and continue...
  warnings.warn('prep_isce.py failed. Assuming its result exists and continue...')
--------------------------------------------------
updateMode : True
compression: None
multilook x/ystep: 1/1
multilook method : nearest
--------------------------------------------------
searching geometry files info
input data files:
height          : ./merged/geom_reference/hgt.rdr
latitude        : ./merged/geom_reference/lat.rdr
longitude       : ./merged/geom_reference/lon.rdr
incidenceAngle  : ./merged/geom_reference/los.rdr
azimuthAngle    : ./merged/geom_reference/los.rdr
shadowMask      : ./merged/geom_reference/shadowMask.rdr
/mnt/e/StackSentinel_Run/DES_2019/inputs/geometryRadar.h5 exists, but can not read, remove it.
--------------------------------------------------
create HDF5 file /mnt/e/StackSentinel_Run/DES_2019/inputs/geometryRadar.h5 with w mode
create dataset /height             of <class 'numpy.float32'>   in size of (613, 929) with compression = lzf
create dataset /latitude           of <class 'numpy.float32'>   in size of (613, 929) with compression = lzf
create dataset /longitude          of <class 'numpy.float32'>   in size of (613, 929) with compression = lzf
create dataset /incidenceAngle     of <class 'numpy.float32'>   in size of (613, 929) with compression = lzf
create dataset /azimuthAngle       of <class 'numpy.float32'>   in size of (613, 929) with compression = lzf
create dataset /shadowMask         of <class 'numpy.bool_'>     in size of (613, 929) with compression = lzf
prepare slantRangeDistance ...
Traceback (most recent call last):
  File "/home/lincoln/miniconda3/envs/mintpy2/bin/smallbaselineApp.py", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/smallbaselineApp.py", line 874, in run
    self.run_load_data(sname)
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/smallbaselineApp.py", line 176, in run_load_data
    mintpy.cli.load_data.main(iargs)
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/cli/load_data.py", line 123, in main
    load_data(inps)
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/load_data.py", line 822, in load_data
    geom_radar_obj.write2hdf5(
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/objects/stackDict.py", line 759, in write2hdf5
    data = self.get_slant_range_distance(box=box, xstep=xstep, ystep=ystep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/objects/stackDict.py", line 502, in get_slant_range_distance
    data = ut.range_distance(self.extraMetadata,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lincoln/miniconda3/envs/mintpy2/lib/python3.11/site-packages/mintpy/utils/utils0.py", line 78, in range_distance
    range_n, dR = float(atr['STARTING_RANGE']), float(atr['RANGE_PIXEL_SIZE'])
                        ~~~^^^^^^^^^^^^^^^^^^
KeyError: 'STARTING_RANGE'

The numpy version that was installed was 1.24.2.

The error is very similar to the tagged issue, and I can't try to install a downgraded version since my libgcc that was installed in my terminal is for a more recent version of python (as a suggested fix).

While I try to find a way to troubleshoot this without downgrading to python=3.8, I'd like to report that this issue still persist. Thank you!

System information

  • Operating system: Ubuntu-20.04_WSL
  • Python environment: Miniconda (latest), Python 3.11
  • MintPy version: 1.5.1 (conda version)
@welcome
Copy link

welcome bot commented Mar 3, 2023

👋 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.

@krasny2k5
Copy link

I can confirm that the error persists. I tried with different combinations of isce2/mintpy and numpy/python and I get the error.

It seems that prep_isce.py is having errors.

@yunjunz
Copy link
Member

yunjunz commented Mar 7, 2023

Could you try 1) install the latest development version of mintpy (instruction) and 2) install mintpy and isce2 in the same conda environment?

If the error still persists, could you let me know the following version info, so I could try to re-produce?

  • python
  • numpy
  • scipy
  • isce2
  • mintpy

@lincoln-olayta
Copy link
Author

Hi Dr. Yunjun,

I have tried your suggestions, installing mintpy as development (using conda install -c conda-forge --file requirements.txt to install dependencies), and I've also installed isce2 in the same environment (using conda installation) and it works.

Here's the list of the packages & their versions I've installed:
isce2 = 2.6.2
python = 3.11
numpy = 1.24.2
scipy = 1.10.1
mintpy = development version (1.5.1)

I'm closing the thread. Thank you so much for your help!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants