s1-reader
s1-reader copied to clipboard
Bad number of boundary/center points extracted
Steps to reproduce
$ asfsmd S1A_IW_SLC__1SDV_20150124T165546_20150124T165613_004316_005423_ADFE
$ s1_info S1A_IW_SLC__1SDV_20150124T165546_20150124T165613_004316_005423_ADFE.SAFE/
Error:
Traceback (most recent call last):
File "/Users/staniewi/miniconda3/envs/mapping/bin/s1_info", line 8, in <module>
sys.exit(main())
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_info.py", line 262, in main
for burst in get_bursts(path, args.pol, args.iw):
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_info.py", line 26, in get_bursts
burst_nested_list = [
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_info.py", line 27, in <listcomp>
s1reader.load_bursts(filename, None, iw, pol, flag_apply_eap=False)
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_reader.py", line 878, in load_bursts
bursts = _burst_from_safe_dir(path, id_str, orbit_path,
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_reader.py", line 997, in _burst_from_safe_dir
bursts = burst_from_xml(f_annotation, orbit_path, f_tiff, iw2_f_annotation,
File "/Users/staniewi/repos/s1-reader/src/s1reader/s1_reader.py", line 795, in burst_from_xml
platform_id, safe_filename, center_pts[i],
IndexError: list index out of range
Inside get_burst_centers_and_boundaries:
ipdb> p center_pts
[<POINT (14.688 36.912)>, <POINT (14.649 37.078)>, <POINT (14.61 37.244)>, <POINT (14.571 37.41)>, <POINT (14.531 37.575)>, <POINT (14.492 37.741)>, <POINT (14.453 37.907)>, <POINT (14.409 38.09)>]
ipdb> p len(center_pts)
8
but,
ipdb> p len(burst_list_elements)
9
more failing zips over italy, all early in 2015
S1A_IW_SLC__1SDV_20150205T165551_20150205T165618_004491_00581E_9231.zip
S1A_IW_SLC__1SDV_20150217T165526_20150217T165554_004666_005C23_3BC5.zip
Same issue was found from the granule S1A_IW_SLC__1SSV_20150308T135919_20150308T135946_004941_0062CC_02DF.zip Based on what I investigated, looks like the issue is coming from the annotation file, especially geolocationGridPointList.
All of the inconsistent cases we see here are very old data. I guess this issue take place only on some of the historical data, but I don't have clear evidence to support my hypothesis.
I have written a temporary workaround in the PR #134 to extrapolate the polygon in this case.