isce-framework / s1-reader

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

`get_orbit_file_from_dir` fails to find any orbits, possibly due to padding #130

Closed scottstanie closed 1 year ago

scottstanie commented 1 year ago

How to repeat:

asfsmd --pol vv S1A_IW_SLC__1SDV_20221216T005229_20221216T005257_046350_058D32_2F27
import s1reader
s1reader.get_orbit_file_from_dir("S1A_IW_SLC__1SDV_20221216T005229_20221216T005257_046350_058D32_2F27.SAFE", ".", auto_download=True)
/u/aurora-r0/staniewi/repos/s1-reader/src/s1reader/s1_orbit.py:341: UserWarning: No orbit file was found in the file list provided.
  warnings.warn(msg)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 1
----> 1 s1reader.get_orbit_file_from_dir("S1A_IW_SLC__1SDV_20221216T005229_20221216T005257_046350_058D32_2F27.SAFE", ".", auto_download=True)

File /u/aurora-r0/staniewi/repos/s1-reader/src/s1reader/s1_orbit.py:280, in get_orbit_file_from_dir(zip_path, orbit_dir, auto_download)
    277     return
    279 # Attempt auto download
--> 280 orbit_file = download_orbit(zip_path, orbit_dir)
    281 return orbit_file

File /u/aurora-r0/staniewi/repos/s1-reader/src/s1reader/s1_orbit.py:64, in download_orbit(safe_file, orbit_dir)
     61     orbit_dict = get_orbit_dict(mission_id, start_time,
     62                                 end_time, 'AUX_RESORB')
     63 # Download orbit file
---> 64 orbit_file = os.path.join(orbit_dir, f"{orbit_dict['orbit_name']}.EOF")
     65 if not os.path.exists(orbit_file):
     66     download_orbit_file(orbit_dir, orbit_dict['orbit_url'])

TypeError: 'NoneType' object is not subscriptable
> /u/aurora-r0/staniewi/repos/s1-reader/src/s1reader/s1_orbit.py(64)download_orbit()
     62                                     end_time, 'AUX_RESORB')
     63     # Download orbit file
---> 64     orbit_file = os.path.join(orbit_dir, f"{orbit_dict['orbit_name']}.EOF")
     65     if not os.path.exists(orbit_file):
     66         download_orbit_file(orbit_dir, orbit_dict['orbit_url'])
seongsujeong commented 1 year ago

The version 0.2.2 was able to find and download a POEORB file S1A_OPER_AUX_POEORB_OPOD_20230104T081836_V20221214T225942_20221216T005942.EOF for the granule posted here. Based on the granule and POEORB's start / stop time, I suspect the 30minutes of padding at sensing stop was the culprit.