diff --git a/src/s1reader/s1_reader.py b/src/s1reader/s1_reader.py index 8e98de0..b128dcf 100644 --- a/src/s1reader/s1_reader.py +++ b/src/s1reader/s1_reader.py @@ -876,10 +876,8 @@ def _burst_from_safe_dir(safe_dir_path: str, id_str: str, orbit_path: str, flag_ # find tiff file if measurement directory found if os.path.isdir(f'{safe_dir_path}/measurement'): - measurement_list = os.listdir(f'{safe_dir_path}/measurement') - f_tiff = [f for f in measurement_list - if 'measurement' in f and id_str in f and 'tiff' in f] - f_tiff = f'{safe_dir_path}/measurement/{f_tiff[0]}' if f_tiff else '' + f_tiff = glob.glob(f'{safe_dir_path}/measurement/*{id_str}*tiff') + f_tiff = f_tiff[0] if f_tiff else '' else: msg = f'measurement directory NOT found in {safe_dir_path}' msg += ', continue with metadata only.'