load_data.py problem

277 views
Skip to first unread message

Sayyed Mohammad Javad Mirzadeh

unread,
Mar 25, 2021, 9:11:11 AM3/25/21
to MintPy
Hi Yunjun,

I hope you are doing well and safe.

I am using the MintPy version 1.2.3  and processing the Sentinel-1 datasets. I already did it several times very well but now, I get an error in the step of "load_data.py" as follows:

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

load_data.py --template /data/hbrandon/Project/S/Bridge/mintpy/smallbaselineApp.cfg /data/hbrandon/Project/S/Bridge/mintpy/BridgeSenAT174.txt --project BridgeSenAT174
processor : isce
SAR platform/sensor : Sen
--------------------------------------------------
prepare metadata files for isce products
prep_isce.py -m ../master/IW1.xml -g ../merged/geom_master -b ../baselines -d ../merged/interferograms -f filt_*.unw
extract metadata from ISCE/topsStack xml file: ../master/IW1.xml
/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/load_data.py:661: UserWarning: prep_isce.py failed. Assuming its result exists and continue...
  warnings.warn('prep_isce.py failed. Assuming its result exists and continue...')
Traceback (most recent call last):
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/smallbaselineApp.py", line 1180, in <module>
    main(sys.argv[1:])
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/smallbaselineApp.py", line 1170, in main
    app.run(steps=inps.runSteps, plot=inps.plot)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/smallbaselineApp.py", line 1096, in run
    self.run_load_data(sname)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/smallbaselineApp.py", line 364, in run_load_data
    mintpy.load_data.main(iargs)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/load_data.py", line 769, in main
    iDict = read_subset_box(iDict)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/load_data.py", line 264, in read_subset_box
    pix_box = coord.bbox_geo2radar(geo_box)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/objects/coord.py", line 420, in bbox_geo2radar
    y, x, y_res, x_res = self.geo2radar(lat, lon, print_msg=print_msg)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/objects/coord.py", line 273, in geo2radar
    az_step = azimuth_ground_resolution(self.src_metadata)
  File "/data2/ssangha/conda_installation/stable_feb14_2020/MintPy/mintpy/utils/utils0.py", line 198, in azimuth_ground_resolution
    Re = float(atr['EARTH_RADIUS'])
KeyError: 'EARTH_RADIUS'

it seems that there is not something in the master.xml file but I didn't have the same issue in the previous runs. Could you please guide me to fix it?

Sincerely
Sayyed

Russell Grew

unread,
Mar 31, 2021, 11:45:19 PM3/31/21
to MintPy
Hi Sayyed,

I had this same issue when the merged/interferograms folders in my ISCE stack did not all contain the necessary "filt_*.unw" files. I had been experimenting to determine the limits of the ISCE stack update logic and managed to corrupt the stack.

Removing these folders fixed the problem for me.

Cheers.

nilloofar alizade

unread,
Dec 29, 2022, 8:54:05 AM12/29/22
to MintPy
Dear Mirzadeh,
I had the same problem as you. how did you solve it?

Manudeo Singh

unread,
Dec 29, 2022, 9:41:25 AM12/29/22
to min...@googlegroups.com
Hi,

Not Mirzadeh! I have encountered this problem several times. 

You’ll need to run prep_isce.py manually before you start the mintpy processing. 

I am assuming that you have used ISCE2 workflow to generate the interferogram stack. In your ISCE working directory, run this after activating your ISCE environment -

prep_isce.py -h

You’ll get examples to prepare ISCE files. Use appropriate example - e.g., if you are using sentinel-1, use that example. Modify swath number as required and run it. It will prepare .rac files. 

Sometimes prep_isce.py may not run - if this happens and you get an error with baseline keyword, you’ll need to rerun isce2 baseline step once again. 

Hope it helps. 

Best,
Manu
--
You received this message because you are subscribed to the Google Groups "MintPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mintpy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mintpy/80fd9de9-1de5-442e-9bc3-3370ac1277den%40googlegroups.com.
--
_________________________________
Dr. Manudeo Singh
Alexander von Humboldt Postdoctoral Fellow
Universität Potsdam
University of Potsdam
Institut für Geowissenschaften
Institute of Geosciences
Potsdam, Germany

nilloofar alizade

unread,
Dec 30, 2022, 3:05:35 AM12/30/22
to MintPy
Dear Manudeo, thanks a lot for your help. I try this it. 

Eric Fielding

unread,
Dec 30, 2022, 10:49:37 AM12/30/22
to MintPy
Dear Nilloofar,
You can have problems with the `prep_isce.py` step if the version of ISCE2 that is in your MintPy environment is different from the version that you used to process the data. I created a new conda environment that has both ISCE2 and MintPy in the same environment and process my data in that environment. This makes it easy to load the data into MintPy.
++Eric Fielding

nilloofar alizade

unread,
Jan 20, 2023, 3:12:33 AM1/20/23
to MintPy
Dear Eric, I run prep_isce.py to TSX data and got the following error. Can you tell me how to solve it?
################################################################################################
read perp baseline time-series from ./baselines
preparing RSC file for  filt_*.unw

Traceback (most recent call last):
  File "/usr/local/Tools/MintPy/mintpy/prep_isce.py", line 281, in <module>
    main(sys.argv[1:])
  File "/usr/local/Tools/MintPy/mintpy/prep_isce.py", line 269, in main
    prepare_stack(inps.dsetDir,
  File "/usr/local/Tools/MintPy/mintpy/prep_isce.py", line 198, in prepare_stack
    raise FileNotFoundError('no file found in pattern: {}'.format(filePattern))
FileNotFoundError: no file found in pattern: filt_*.unw
Message has been deleted

nilloofar alizade

unread,
Jan 20, 2023, 3:25:49 AM1/20/23
to MintPy
To clarify I have mintpy and ISCE2 on the same env. When I don't run prep_isce.py and go directly to run mintpy, I get the following error.
###################################################################################################
Traceback (most recent call last):
  File "/usr/local/Tools/MintPy/mintpy/smallbaselineApp.py", line 1293, in <module>
    main(sys.argv[1:])
  File "/usr/local/Tools/MintPy/mintpy/smallbaselineApp.py", line 1275, in main
    app.run(steps=inps.runSteps)
  File "/usr/local/Tools/MintPy/mintpy/smallbaselineApp.py", line 1040, in run
    self.run_load_data(sname)
  File "/usr/local/Tools/MintPy/mintpy/smallbaselineApp.py", line 349, in run_load_data
    mintpy.load_data.main(iargs)
  File "/usr/local/Tools/MintPy/mintpy/load_data.py", line 834, in main
    iDict = read_subset_box(iDict)
  File "/usr/local/Tools/MintPy/mintpy/load_data.py", line 271, in read_subset_box
    pix_box = coord.bbox_geo2radar(geo_box)
  File "/usr/local/Tools/MintPy/mintpy/objects/coord.py", line 454, in bbox_geo2radar

    y, x, y_res, x_res = self.geo2radar(lat, lon, print_msg=print_msg)
  File "/usr/local/Tools/MintPy/mintpy/objects/coord.py", line 307, in geo2radar
    az_step = ut0.azimuth_ground_resolution(self.src_metadata)
  File "/usr/local/Tools/MintPy/mintpy/utils/utils0.py", line 199, in azimuth_ground_resolution

    Re = float(atr['EARTH_RADIUS'])
KeyError: 'EARTH_RADIUS'

On Friday, December 30, 2022 at 7:19:37 PM UTC+3:30 Eric.J....@jpl.nasa.gov wrote:

Pinglan GE

unread,
Aug 15, 2023, 2:46:40 AM8/15/23
to MintPy
Dear  Nilloofar,

I have the same [KeyError: 'EARTH_RADIUS'problem as you. how did you solve it?

I have installed ISCE and Mintpy in the same conda environment according to the suggestion of Eric. 
My isce version is 2.6.3 and Mintpy version is 1.5.2.

No matter I run smallbaselineApp.py directly or run prep_isce.py seperately,  the execution of "prep_isce.py" showed [Done.] without error, and that of the "utils0.py" showed [KeyError: 'EARTH_RADIUS'].
I have also tried to print the information of self.src_metadata,  and found there sames to be really no key of EARTH_RADIUS.

Thank you in advance!

Eric Fielding

unread,
Aug 15, 2023, 1:20:10 PM8/15/23
to MintPy
It is not enough to have ISCE2 and MintPy installed in the same environment, you have to use that version of ISCE to process the data. These errors are caused by trying to read data processed with a different version of ISCE.

Pinglan GE

unread,
Aug 15, 2023, 9:04:40 PM8/15/23
to MintPy
Dear Eric,

Thank you very much for your reply!
May I ask how can I check the version of ISCE used in Mintpy? I would like to install ISCE that has the same version according to your suggestion.

Thank you very much!

Sincerely
Ping

Sayyed Mohammad Javad Mirzadeh

unread,
Aug 16, 2023, 7:38:05 PM8/16/23
to MintPy
Hi Ping,

As I know, the latest version of MintPy and ISCE v2.6.1 are compatible together well. I installed these versions in many systems in the same environment and everything goes well.

Sincerely,
Sayyed



Eric Fielding

unread,
Aug 16, 2023, 8:55:16 PM8/16/23
to MintPy
You can see what version of ISCE2 you have installed by running one of the apps, such as `stripmapApp.py -h`. I see this:
```
stripmapApp.py -h
2023-08-16 17:52:39,904 - isce.insar - INFO - ISCE VERSION = 2.6.3, RELEASE_SVN_REVISION = ,RELEASE_DATE = 20230418, CURRENT_SVN_REVISION =
ISCE VERSION = 2.6.3, RELEASE_SVN_REVISION = ,RELEASE_DATE = 20230418, CURRENT_SVN_REVISION =
```

Reply all
Reply to author
Forward
0 new messages