isce-framework / s1-reader

Sentinel-1 reader
Apache License 2.0
27 stars 12 forks source link

[Bug]: Loading bursts from S1 SAFE data processed by IPF 2.36 (and possibly earlier versions) #51

Closed seongsujeong closed 2 years ago

seongsujeong commented 2 years ago

Checked for duplicates

Yes - I've already checked

Describe the bug

I tried to load bursts from SAFE .zip file processed by IPF version 2.36. Running the code was not successful with the error message below:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/compass_user/miniconda3/envs/COMPASS/lib/python3.9/site-packages/s1reader/s1_reader.py", line 474, in load_bursts
    bursts = _burst_from_safe_dir(path, id_str, orbit_path)
  File "/home/compass_user/miniconda3/envs/COMPASS/lib/python3.9/site-packages/s1reader/s1_reader.py", line 583, in _burst_from_safe_dir
    bursts = burst_from_xml(f_annotation, orbit_path, f_tiff, iw2_f_annotation)
  File "/home/compass_user/miniconda3/envs/COMPASS/lib/python3.9/site-packages/s1reader/s1_reader.py", line 309, in burst_from_xml
    az_fm_rate_list = [parse_polynomial_element(x, poly_name) for x in az_rate_list_element]
  File "/home/compass_user/miniconda3/envs/COMPASS/lib/python3.9/site-packages/s1reader/s1_reader.py", line 309, in <listcomp>
    az_fm_rate_list = [parse_polynomial_element(x, poly_name) for x in az_rate_list_element]
  File "/home/compass_user/miniconda3/envs/COMPASS/lib/python3.9/site-packages/s1reader/s1_reader.py", line 52, in parse_polynomial_element
    coeffs = [float(x) for x in elem.find(poly_name).text.split()]

What did you expect?

I expected a list of bursts as output. The reader worked well with the data processed by IPF 3.31

Reproducible steps

The below is the code that I tried to load bursts from SAFE .zip file. The data is processed by IPF version 2.36.

path_safe='S1A_IW_SLC__1SSV_20150114T015005_20150114T015035_004161_0050BB_87F4.zip'
path_orbit='S1A_OPER_AUX_POEORB_OPOD_20150204T122622_V20150113T225944_20150115T005944.EOF'
bursts=s1reader.load_bursts(path_safe, path_orbit, 1, 'vv')

The sample data above is stored in the internal server.

Environment

Tested environments:
- MacOS
- Linux (by @vbrancat)
- Docker container (base image: Ubuntu 22.04)
seongsujeong commented 2 years ago

Fixed in the PR #59