KeyError: 'DATE12' smallbaselineApp.py for gmtsar
I have installed mintpy1.4.1 via conda linux, I'm using gmtsar6.2 as preprocessor and I get the following error when executing smallbaselineApp.py. This process runs without problem on Macos Monterey, however on linux I have KeyError: 'DATE12'.
number of unwrapPhase : 223
number of coherence : 223
Traceback (most recent call last):
File "/home/cyclo/miniconda3/envs/mintpy/bin/smallbaselineApp.py", line 8, in
System information
- Operating system: Linux openSuSE Leap 15.3
- Python environment: conda
- MintPy version: MintPy version 1.4.1, date 2022-08-15
manually specify the following attributes since they are missing from gmtsar products
HEADING = -164.296 #[float], satellite heading angle, measured from the north in clockwise as positive # One could open the *.kml file in Google Earth and measure it manually ORBIT_DIRECTION = DESCENDING #[ASCENDING, DESCENDING]
mintpy.load.processor = gmtsar ##---------interferogram datasets: mintpy.load.unwFile = F2/intf_all//unwrap_ll.grd mintpy.load.corFile = F2/intf_all//corr_ll.grd ##---------geometry datasets: mintpy.load.demFile = F2/topo/dem_ll.grd
👋 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.
Hi @mcontk, the DATE12 metadata is generated by prep_gmtsar.py. I guess there is a warning message there, could you confirm?
If so, please manually run the prep_gmtsar.py command as printed out before that warning msg, so that we could get a more detailed diagnose.
(mintpy) smallbaselineApp.py LagMauleSenDT83.txt
___________________________________________________________
/## /## /## /## /#######
| ### /###|__/ | ## | ##__ ##
| #### /#### /## /####### /###### | ## \ ## /## /##
| ## ##/## ##| ##| ##__ ##|_ ##_/ | #######/| ## | ##
| ## ###| ##| ##| ## \ ## | ## | ##____/ | ## | ##
| ##\ # | ##| ##| ## | ## | ## /##| ## | ## | ##
| ## \/ | ##| ##| ## | ## | ####/| ## | #######
|__/ |__/|__/|__/ |__/ \___/ |__/ \____ ##
/## | ##
| ######/
Miami InSAR Time-series software in Python \______/
MintPy 1.4.1, 2022-08-15
___________________________________________________________
--RUN-at-2022-10-16 01:22:10.421606--
Current directory: /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule
Run routine processing with smallbaselineApp.py on steps: ['load_data', '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']
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']
--------------------------------------------------
Project name: LagMauleSenDT83
Go to work directory: /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule
read custom template file: /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/LagMauleSenDT83.txt
update default template based on input custom template
No new option value found, skip updating /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/smallbaselineApp.cfg
read default template file: /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/smallbaselineApp.cfg
******************** step - load_data ********************
load_data.py --template /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/smallbaselineApp.cfg /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/LagMauleSenDT83.txt --project LagMauleSenDT83
processor : gmtsar
SAR platform/sensor : Sen
--------------------------------------------------
prepare metadata files for gmtsar products
prep_gmtsar.py /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/LagMauleSenDT83.txt
['/home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/inputs/data.rsc'] exists and is newer than ['/home/cyclo/Insar/Processing/descending/MAULE/F2/intf_all/2020000_2020012/unwrap_ll.grd'] --> skip.
write file: /home/cyclo/Insar/Processing/descending/MAULE/F2/topo/dem_ll.grd.rsc
/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/load_data.py:859: UserWarning: prep_gmtsar.py failed. Assuming its result exists and continue...
warnings.warn('prep_gmtsar.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 : /home/cyclo/Insar/Processing/descending/MAULE/F2/topo/dem_ll.grd
--------------------------------------------------
create HDF5 file /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/inputs/geometryGeo.h5 with w mode
create dataset /height of <class 'numpy.float32'> in size of (3650, 4440) with compression = lzf
geocoded input, use contant value from metadata INCIDENCE_ANGLE
prepare slantRangeDistance ...
Finished writing to /home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/inputs/geometryGeo.h5
--------------------------------------------------
searching interferogram pairs info
input data files:
unwrapPhase : /home/cyclo/Insar/Processing/descending/MAULE/F2/intf_all/*/unwrap_ll.grd
coherence : /home/cyclo/Insar/Processing/descending/MAULE/F2/intf_all/*/corr_ll.grd
number of unwrapPhase : 223
number of coherence : 223
Traceback (most recent call last):
File "/home/cyclo/miniconda3/envs/mintpy/bin/smallbaselineApp.py", line 8, in <module>
sys.exit(main())
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 1291, in main
app.run(steps=inps.runSteps)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 1047, in run
self.run_load_data(sname)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 356, in run_load_data
mintpy.load_data.main(iargs)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/load_data.py", line 957, in main
stack_obj = read_inps_dict2ifgram_stack_dict_object(iDict, ds_name2tmpl_opt)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/load_data.py", line 487, in read_inps_dict2ifgram_stack_dict_object
date6s = readfile.read_attribute(dsPath0)['DATE12'].replace('_','-').split('-')
KeyError: 'DATE12'
Well, here are the two outputs of : smallbaselineApp.py and prep_gmtsar.py
(mintpy) prep_gmtsar.py LagMauleSenDT83.txt
['/home/cyclo/Insar/Processing/descending/MAULE/mintpy_LagMaule/inputs/data.rsc'] exists and is newer than ['/home/cyclo/Insar/Processing/descending/MAULE/F2/intf_all/2020000_2020012/unwrap_ll.grd'] --> skip.
write file: /home/cyclo/Insar/Processing/descending/MAULE/F2/topo/dem_ll.grd.rsc
Traceback (most recent call last):
File "/home/cyclo/miniconda3/envs/mintpy/bin/prep_gmtsar.py", line 8, in <module>
sys.exit(main())
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/prep_gmtsar.py", line 308, in main
prepare_stack(inps.unw_files, meta=meta, update_mode=inps.update_mode)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/prep_gmtsar.py", line 266, in prepare_stack
bDict = readfile.read_template(baseline_file)
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/site-packages/mintpy/utils/readfile.py", line 1233, in read_template
lines = f.readlines()
File "/home/cyclo/miniconda3/envs/mintpy/lib/python3.10/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x86 in position 0: invalid start byte
Resolved. For some reason SAT_baseline of gmtsar 6.2 writes strange characters in the first line of baseline.txt.
Ü ≠˚SC_identity = 10 lon_tie_point = -70.507878 lat_tie_point = -35.974516 SC_vel = 7180.674026000000 SC_height = 710500.039365506731 SC_height_start = 710473.846000434831 SC_height_end = 710525.900243796408 earth_radius = 6370287.340828999877 rshift = 0 sub_int_r = 0.0 ashift = -1 sub_int_a = 0.0 B_parallel = -9.316342510778 B_perpendicular = -12.722828855006 baseline_start = 15.769103076963 baseline_center = 16.519808534066 baseline_end = 17.270308612189 alpha_start = -177.796846670555 alpha_center = -178.178475163421 alpha_end = -178.526957972640 B_offset_start = 8.282454783860 B_offset_center = 8.306043352259 B_offset_end = 8.330218750874
Close this issue as the cause has been identified and is out of mintpy.