insarlab / MintPy

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

processing fails in working directory with whitespace in path #395

Closed EJFielding closed 4 years ago

EJFielding commented 4 years ago

Description of the problem

I have a directory on my Mac that is synced to Google Drive with the full name /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/. I normally work by cd'ing to a symbolic link /Users/fielding/Google_Drive_JPL NepalSenD019.txt

and other programs seem happy to use that as the path, but smallbaselineApp.py is finding the actual directory name and then choking on the "(".

Full script that generated the error

smallbaselineApp.py NepalSenD019.txt

Full error message


_________________________________________________
 ____    ____   _            _   _______
|_   \  /   _| (_)          / |_|_   __ \
  |   \/   |   __   _ .--. `| |-' | |__) |_   __
  | |\  /| |  [  | [ `.-. | | |   |  ___/[ \ [  ]
 _| |_\/_| |_  | |  | | | | | |, _| |_    \ '/ /
|_____||_____|[___][___||__]\__/|_____| [\_:  /
                                         \__.'

   Miami InSAR Time-series software in Python
          MintPy v1.2.2-62, 2020-07-04
_________________________________________________

--RUN-at-2020-07-09 14:47:22.680480--
Run routine processing with smallbaselineApp.py on steps: ['load_data', 'modify_network', 'reference_point', 'quick_overview', 'correct_unwrap_error', 'invert_network', 'correct_LOD', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']
Remaining steps: ['modify_network', 'reference_point', 'quick_overview', 'correct_unwrap_error', 'invert_network', 'correct_LOD', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']
--------------------------------------------------
Project name: NepalSenD019
Go to work directory: /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019
copy default template file /Users/fielding/tools/mintpy/mintpy/defaults/smallbaselineApp.cfg to work directory
read custom template file: /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/NepalSenD019.txt
update default template based on input custom template
    mintpy.load.processor: auto --> aria
    mintpy.load.unwFile: auto --> ../stack/unwrapStack.vrt
    mintpy.load.corFile: auto --> ../stack/cohStack.vrt
    mintpy.load.connCompFile: auto --> ../stack/connCompStack.vrt
    mintpy.load.demFile: auto --> ../DEM/SRTM_3arcsec.dem
    mintpy.load.incAngleFile: auto --> ../incidenceAngle/20200601_20190514.vrt
    mintpy.load.azAngleFile: auto --> ../azimuthAngle/20200601_20190514.vrt
    mintpy.load.waterMaskFile: auto --> ../mask/watermask.msk
    mintpy.network.coherenceBased: auto --> no
    mintpy.network.keepMinSpanTree: auto --> yes
    mintpy.networkInversion.weightFunc: auto --> no
    mintpy.troposphericDelay.method: auto --> no
    mintpy.deramp: auto --> no
    mintpy.topographicResidual: auto --> no
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `mv /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/smallbaselineApp.cfg.tmp /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/smallbaselineApp.cfg'
copy NepalSenD019.txt to inputs directory for backup.
copy smallbaselineApp.cfg to inputs directory for backup.
copy NepalSenD019.txt to pic directory for backup.
copy smallbaselineApp.cfg to pic directory for backup.
read default template file: /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/smallbaselineApp.cfg

******************** step - load_data ********************
load_data.py --template /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/smallbaselineApp.cfg /Users/fielding/Google Drive (fielding@jpl.caltech.edu)/Tibet-Drive/ARIA-S1/Nepal_D019/NepalSenD019.txt --project NepalSenD019
SAR platform/sensor : Sen
processor: isce
Traceback (most recent call last):
  File "/Users/fielding/tools/mintpy/mintpy/smallbaselineApp.py", line 1117, in <module>
    main()
  File "/Users/fielding/tools/mintpy/mintpy/smallbaselineApp.py", line 1107, in main
    app.run(steps=inps.runSteps, plot=inps.plot)
  File "/Users/fielding/tools/mintpy/mintpy/smallbaselineApp.py", line 1036, in run
    self.run_load_data(sname)
  File "/Users/fielding/tools/mintpy/mintpy/smallbaselineApp.py", line 362, in run_load_data
    mintpy.load_data.main(scp_args.split())
  File "/Users/fielding/tools/mintpy/mintpy/load_data.py", line 624, in main
    inpsDict = read_inps2dict(inps)
  File "/Users/fielding/tools/mintpy/mintpy/load_data.py", line 174, in read_inps2dict
    if inpsDict['autoPath']:
KeyError: 'autoPath'

System information

yunjunz commented 4 years ago

Thank you for identifying this @EJFielding, I was able to reproduce the same errors you have. They are caused by the splitting the dir string with whitespace. Now they should all be fixed.

EJFielding commented 4 years ago

Thanks @yunjunz, now it works. I am surprised that nobody else had tried a directory with whitespace characters in the path. I thought it was the more unusual "(" character, but I see it was the " " before.